diff --git a/memcheck/tests/badjump.c b/memcheck/tests/badjump.c index b02c49397..9cf52670c 100644 --- a/memcheck/tests/badjump.c +++ b/memcheck/tests/badjump.c @@ -7,14 +7,13 @@ int main ( void ) descriptor, not to the function's entry point. Hence to get uniform behaviour on all supported targets - a jump to an unmapped page - the following is needed. */ - unsigned long long int fake_fndescr[3]; - fake_fndescr[0] = (unsigned long long int)get_unmapped_page(); - fake_fndescr[1] = 0; - fake_fndescr[2] = 0; - return ((int(*)(void)) fake_fndescr) (); + unsigned long long int p[3]; + p[0] = (unsigned long long int)get_unmapped_page(); + p[1] = 0; + p[2] = 0; #else char* p = get_unmapped_page(); - return ((int(*)(void)) p) (); #endif + return ((int(*)(void)) p) (); } diff --git a/memcheck/tests/badjump.stderr.exp b/memcheck/tests/badjump.stderr.exp index 1cecc0a9c..e2659dee6 100644 --- a/memcheck/tests/badjump.stderr.exp +++ b/memcheck/tests/badjump.stderr.exp @@ -1,12 +1,14 @@ Jump to the invalid address stated on the next line ... + by 0x........: main (badjump.c:17) Address 0x........ is not stack'd, malloc'd or (recently) free'd Process terminating with default action of signal 11 (SIGSEGV) Access not within mapped region at address 0x........ ... + by 0x........: main (badjump.c:17) If you believe this happened as a result of a stack overflow in your program's main thread (unlikely but possible), you can try to increase the size of the diff --git a/memcheck/tests/badjump.stderr.exp-s390x b/memcheck/tests/badjump.stderr.exp-kfail similarity index 91% rename from memcheck/tests/badjump.stderr.exp-s390x rename to memcheck/tests/badjump.stderr.exp-kfail index e2659dee6..1cecc0a9c 100644 --- a/memcheck/tests/badjump.stderr.exp-s390x +++ b/memcheck/tests/badjump.stderr.exp-kfail @@ -1,14 +1,12 @@ Jump to the invalid address stated on the next line ... - by 0x........: main (badjump.c:17) Address 0x........ is not stack'd, malloc'd or (recently) free'd Process terminating with default action of signal 11 (SIGSEGV) Access not within mapped region at address 0x........ ... - by 0x........: main (badjump.c:17) If you believe this happened as a result of a stack overflow in your program's main thread (unlikely but possible), you can try to increase the size of the diff --git a/memcheck/tests/badjump2.c b/memcheck/tests/badjump2.c index 648872492..47a682986 100644 --- a/memcheck/tests/badjump2.c +++ b/memcheck/tests/badjump2.c @@ -36,15 +36,14 @@ int main(void) if (__builtin_setjmp(myjmpbuf) == 0) { // Jump to zero; will cause seg fault #if defined(__powerpc64__) - unsigned long int fake_fndescr[3]; - fake_fndescr[0] = 0; - fake_fndescr[1] = 0; - fake_fndescr[2] = 0; - ((void(*)(void)) fake_fndescr) (); + unsigned long int fn[3]; + fn[0] = 0; + fn[1] = 0; + fn[2] = 0; #else void (*fn)(void) = 0; - fn(); #endif + ((void(*)(void)) fn) (); fprintf(stderr, "Got here??\n"); } else { fprintf(stderr, "Signal caught, as expected\n"); diff --git a/memcheck/tests/badjump2.stderr.exp b/memcheck/tests/badjump2.stderr.exp index 35ce6f0cc..7033e69d7 100644 --- a/memcheck/tests/badjump2.stderr.exp +++ b/memcheck/tests/badjump2.stderr.exp @@ -1,5 +1,6 @@ Jump to the invalid address stated on the next line ... + by 0x........: main (badjump2.c:46) Address 0x........ is not stack'd, malloc'd or (recently) free'd Signal caught, as expected diff --git a/memcheck/tests/badjump2.stderr.exp-s390x b/memcheck/tests/badjump2.stderr.exp-kfail similarity index 79% rename from memcheck/tests/badjump2.stderr.exp-s390x rename to memcheck/tests/badjump2.stderr.exp-kfail index 7033e69d7..35ce6f0cc 100644 --- a/memcheck/tests/badjump2.stderr.exp-s390x +++ b/memcheck/tests/badjump2.stderr.exp-kfail @@ -1,6 +1,5 @@ Jump to the invalid address stated on the next line ... - by 0x........: main (badjump2.c:46) Address 0x........ is not stack'd, malloc'd or (recently) free'd Signal caught, as expected