Skip to content

Commit 7712ebd

Browse files
committed
Fix: Seg fault if mocked function gets called in yt_reset
This can happen for example if a SUT function is called in yt_reset which internally calls an external (mocked) function. This mocked function call causes a call to RECORD_CALL before the test specific linked lists have been initialized (which happens in YT__ec_init) causing seg fault.
1 parent bc43a09 commit 7712ebd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yukti.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,8 @@ static int YT__equal_mem (const void* a, const void* b, unsigned long size, int*
10001000
#define YT_ARG_9() _j
10011001

10021002
#define YT__TEST_IMPL_BODY(tf, fn, count, tn, ...) \
1003-
yt_reset(); \
10041003
YT__ec_init(); \
1004+
yt_reset(); \
10051005
YT__total_test_count++; \
10061006
/* Following assert ensures we are not overriding it. It was taken cared of \
10071007
* in the previous test's YT_END. */ \

0 commit comments

Comments
 (0)