-
Notifications
You must be signed in to change notification settings - Fork 72
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 #1265 from goblint/mutex-meet-tid-memsafety
Test for `mutex-meet-tid` for ValidDeref & Move `Afterconfig.run` to ensure privatizations can potentially be auto-tuned
- Loading branch information
Showing
3 changed files
with
23 additions
and
2 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 @@ | ||
//PARAM: --set ana.path_sens[+] threadflag --set ana.activated[+] memOutOfBounds --set ana.base.privatization mutex-meet-tid | ||
#include <pthread.h> | ||
|
||
int data; | ||
int *p = &data, *q; | ||
pthread_mutex_t mutex; | ||
void *t_fun(void *arg) { | ||
pthread_mutex_lock(&mutex); | ||
*p = 8; | ||
pthread_mutex_unlock(&mutex); | ||
return ((void *)0); | ||
} | ||
int main() { | ||
pthread_t id; | ||
pthread_create(&id, ((void *)0), t_fun, ((void *)0)); | ||
q = p; | ||
pthread_mutex_lock(&mutex); | ||
*q = 8; //NOWARN | ||
pthread_mutex_unlock(&mutex); | ||
return 0; | ||
} |