-
Notifications
You must be signed in to change notification settings - Fork 77
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 #1323 from goblint/threadEscape-combine_assign
Implement `combine_assign` in `threadEscape`
- Loading branch information
Showing
5 changed files
with
50 additions
and
18 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
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,9 @@ | ||
open GoblintCil | ||
module AD = ValueDomain.AD | ||
|
||
let return_varstore = ref dummyFunDec.svar | ||
let return_varinfo () = !return_varstore | ||
let return_var () = AD.of_var (return_varinfo ()) | ||
let return_lval (): lval = (Var (return_varinfo ()), NoOffset) | ||
|
||
let longjmp_return = ref dummyFunDec.svar |
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,25 @@ | ||
#include <pthread.h> | ||
#include <goblint.h> | ||
|
||
int* gptr; | ||
|
||
void *foo(void* p){ | ||
*gptr = 17; | ||
return NULL; | ||
} | ||
|
||
int* id(int* x) { | ||
return x; | ||
} | ||
|
||
int main(){ | ||
int x = 0; | ||
gptr = id(&x); | ||
__goblint_check(x==0); | ||
pthread_t thread; | ||
pthread_create(&thread, NULL, foo, NULL); | ||
sleep(3); | ||
__goblint_check(x == 0); // UNKNOWN! | ||
pthread_join(thread, NULL); | ||
return 0; | ||
} |