X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=blobdiff_plain;f=src%2Ftests%2Fuserprog%2Fbad-jump.c;h=a915c396b874e5338daecf0cd3f4d6aa1150deee;hp=51b7c9f57ea6a15cfe60a254a7fb3cd04fae87ea;hb=d18533cc294552c39f69781e5a9b04b8882b6364;hpb=f5fa837e313d018a945eaedd28352e7f24e5b1a6 diff --git a/src/tests/userprog/bad-jump.c b/src/tests/userprog/bad-jump.c index 51b7c9f..a915c39 100644 --- a/src/tests/userprog/bad-jump.c +++ b/src/tests/userprog/bad-jump.c @@ -4,10 +4,13 @@ #include "tests/lib.h" #include "tests/main.h" +typedef int (* volatile functionptr)(void); + void test_main (void) { + functionptr fp = NULL; msg ("Congratulations - you have successfully called NULL: %d", - ((int (*)(void))NULL)()); + fp()); fail ("should have exited with -1"); }