@@ -197,6 +197,7 @@ for arch in $ARCHS; do
197
197
esac
198
198
done
199
199
done
200
+ TEST_ASAN_CFGUARD=
200
201
for test in $TESTS_ASAN ; do
201
202
case $arch in
202
203
# Sanitizers on windows only support x86.
@@ -208,6 +209,7 @@ for arch in $ARCHS; do
208
209
# Only run these tests on native windows; asan doesn't run in wine.
209
210
if [ -n " $NATIVE " ]; then
210
211
TESTS_EXTRA=" $TESTS_EXTRA $test "
212
+ TEST_ASAN_CFGUARD=" $TEST_ASAN_CFGUARD $test "
211
213
fi
212
214
done
213
215
for test in $TESTS_UBSAN ; do
@@ -267,21 +269,22 @@ for arch in $ARCHS; do
267
269
if $RUN $test .exe check_enabled; then
268
270
$RUN $test .exe normal_icall
269
271
$RUN $test .exe invalid_icall_nocf || [ $? = 2 ]
270
- # We want to check the exit code to be 0xc0000409. MSYS2 bash
271
- # does not give us the full 8-bit exit code, so we have to rely
272
- # on cmd.exe to perform the check.
272
+ # We want to check the exit code to be 0xc0000409
273
+ # (STATUS_STACK_BUFFER_OVERRUN aka fail fast exception). MSYS2
274
+ # bash does not give us the full 32-bit exit code, so we have
275
+ # to rely on cmd.exe to perform the check.
276
+ # (This doesn't work on WINE, but WINE doesn't support CFG
277
+ # anyway, at least not for now...)
273
278
cmd //c " $test .exe invalid_icall & if errorlevel -1073740791 (if not errorlevel -1073740790 (exit 0)) & exit 1"
274
279
fi
275
280
fi
276
281
done
277
- if [ -n " $NATIVE " ]; then
278
- for test in $TESTS_ASAN ; do
279
- if [ -n " $RUN " ]; then
280
- $RUN $test -asan-cfguard.exe
281
- $RUN $test -asan-cfguard.exe crash || echo $?
282
- fi
283
- done
284
- fi
282
+ for test in $TEST_ASAN_CFGUARD ; do
283
+ if [ -n " $RUN " ]; then
284
+ $RUN $test -asan-cfguard.exe
285
+ $RUN $test -asan-cfguard.exe crash || echo $?
286
+ fi
287
+ done
285
288
cd ..
286
289
done
287
290
echo All tests succeeded
0 commit comments