-
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.
Enable
mutex-meet-tid
for ValidDeref
- Loading branch information
1 parent
9c808c9
commit 17ebe80
Showing
2 changed files
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//PARAM: --set ana.activated[+] useAfterFree --set ana.activated[+] threadJoins --set ana.path_sens[+] threadflag --set ana.activated[+] memOutOfBounds --enable ana.int.interval --set ana.base.arrays.domain partitioned --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; | ||
pthread_mutex_unlock(&mutex); | ||
return 0; | ||
} |