Skip to content

Commit be4d3de

Browse files
committed
Fix mine-W-noinit threadenter to reset W
1 parent ba39674 commit be4d3de

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/analyses/basePriv.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,11 +1255,11 @@ struct
12551255
else
12561256
st
12571257

1258-
let threadenter =
1258+
let threadenter ask st =
12591259
if Param.side_effect_global_init then
1260-
startstate_threadenter startstate
1260+
startstate_threadenter startstate ask st
12611261
else
1262-
old_threadenter
1262+
{(old_threadenter ask st) with priv = W.empty ()}
12631263
end
12641264

12651265
module LockCenteredD =

tests/regression/13-privatized/96-mine-W-threadenter.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void *t_fun(void *arg) {
1111

1212
void *t_fun2(void *arg) {
1313
pthread_mutex_lock(&A);
14-
pthread_mutex_unlock(&A); // spuriously publishes g = 8
14+
pthread_mutex_unlock(&A); // used to spuriously publish g = 8
1515
return NULL;
1616
}
1717

@@ -21,12 +21,12 @@ int main() {
2121

2222
pthread_mutex_lock(&A);
2323
g = 8;
24-
pthread_create(&id2, NULL, t_fun2, NULL); // passes g = 8 and W: A -> {g} to t_fun2
24+
pthread_create(&id2, NULL, t_fun2, NULL); // used to pass g = 8 and W: A -> {g} to t_fun2
2525
g = 0;
2626
pthread_mutex_unlock(&A);
2727

2828
pthread_mutex_lock(&A);
29-
__goblint_check(g == 0); // TODO
29+
__goblint_check(g == 0);
3030
pthread_mutex_unlock(&A);
3131
return 0;
3232
}

0 commit comments

Comments
 (0)