Skip to content

Commit 3bc511d

Browse files
FAPGLaguna1989
authored andcommitted
Placing a guard for undefined behaviour that appears to trigger sanitizers.
1 parent cf198b6 commit 3bc511d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ApprovalTests/integrations/catch/Catch2Approvals.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ struct Catch2ApprovalListener : Catch::TestEventListenerBase
4848

4949
virtual void sectionEnded(Catch::SectionStats const& /*sectionStats*/) override
5050
{
51-
currentTest.sections.pop_back();
51+
if (!currentTest.sections.empty())
52+
{
53+
currentTest.sections.pop_back();
54+
}
5255
}
5356
};
5457
//}

0 commit comments

Comments
 (0)