diff options
Diffstat (limited to 'tests/auto/testlib/selftests/crashes/tst_crashes.cpp')
-rw-r--r-- | tests/auto/testlib/selftests/crashes/tst_crashes.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp index b6298f5e63..c2174e90e8 100644 --- a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp +++ b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp @@ -61,8 +61,14 @@ void tst_Crashes::crash() //we avoid the error dialogbox to appear on windows SetErrorMode( SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); #endif + /* + We deliberately dereference an invalid but non-zero address; + it should be non-zero because a few platforms may have special crash behavior + when dereferencing exactly 0 (e.g. some macs have been observed to generate SIGILL + rather than SIGSEGV). + */ int *i = 0; - *i = 1; + i[1] = 1; } QTEST_MAIN(tst_Crashes) |