aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-03-02 19:58:52 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-03-02 19:58:52 -0800
commitf46b3d8c5787c895510277c9ab0e2faf646f05ea (patch)
tree571c3b3658d421f64b97cffecccf733ea39362d5 /tests
parentee4b996cd331212686ecbbd03da79bf87b121512 (diff)
fix ASSERTIONS output on bad function pointer calls
Diffstat (limited to 'tests')
-rw-r--r--tests/test_other.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_other.py b/tests/test_other.py
index b86af5cc..9f7d2eeb 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -560,8 +560,8 @@ f.close()
test(['-O1', '-s', 'ASSERTIONS=1'], '''Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)
Build with ASSERTIONS=2 for more info.
''') # some useful text
- test(['-O1', '-s', 'ASSERTIONS=2'], '''Invalid function pointer '1' called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)
-This pointer might make sense in another type signature: i: _my_func
+ test(['-O1', '-s', 'ASSERTIONS=2'], '''Invalid function pointer '0' called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)
+This pointer might make sense in another type signature: i: 0
''') # actually useful identity of the bad pointer, with comparisons to what it would be in other types/tables
def test_l_link(self):
@@ -2524,7 +2524,7 @@ int main()
for opts, expected, compile_expected in [
([], ['abort()', 'it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this'], []),
- (['-s', 'ASSERTIONS=2'], ['abort()', 'This pointer might make sense in another type signature: ii: _strnlen'], []),
+ (['-s', 'ASSERTIONS=2'], ['abort()', 'This pointer might make sense in another type signature'], []),
(['-O1'], ['hello 2\nhello 5\n'], []), # invalid output - second arg is sent as varargs, but needs to be int. llvm optimizer avoided the crash silently, caused undefined behavior... at least people can debug this by running an -O0 build.
]:
print opts, expected