-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1210 from goblint/longjmp-top
Fix longjmp crash on Uninitialized
- Loading branch information
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Extracted from concrat/pigz. | ||
#include <setjmp.h> | ||
#include <pthread.h> | ||
#include <goblint.h> | ||
|
||
pthread_key_t buf_key; | ||
|
||
int main() { | ||
jmp_buf buf; | ||
pthread_setspecific(buf_key, &buf); | ||
|
||
if (!setjmp(buf)) { | ||
jmp_buf *buf_ptr; | ||
buf_ptr = pthread_getspecific(buf_key); | ||
longjmp(*buf_ptr, 1); // NO CRASH: problem?! | ||
} | ||
else { | ||
__goblint_check(1); // TODO reachable: https://github.com/goblint/analyzer/pull/1210#discussion_r1350021903 | ||
} | ||
return 0; | ||
} |