Skip to content

Commit b31783e

Browse files
author
Enrico Steffinlongo
committed
Fix shadow memory global1 regression test
1 parent 2daecc3 commit b31783e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

regression/cbmc-shadow-memory/global1/main.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void dynamically_allocated_structs()
155155
assert(__CPROVER_get_field(&(p->B1[1]), "field2") == 2);
156156
assert(__CPROVER_get_field(&(p->B1[2]), "field1") == 0);
157157

158-
q = &(p->B1[2]);
158+
int *q = &(p->B1[2]);
159159
assert(__CPROVER_get_field(q, "field1") == 0);
160160
__CPROVER_set_field(q, "field1", 7);
161161
assert(__CPROVER_get_field(q, "field1") == 7);
@@ -187,7 +187,7 @@ void arrays_of_structs_and_pointers_into_them()
187187
assert(__CPROVER_get_field(&(n[1].B1[1]), "field2") == 3);
188188
assert(__CPROVER_get_field(&(p->B1[1]), "field2") == 4);
189189

190-
q = &(n[1].x1);
190+
int *q = &(n[1].x1);
191191
assert(__CPROVER_get_field(q, "field1") == 1);
192192
__CPROVER_set_field(q, "field1", 5);
193193
assert(__CPROVER_get_field(q, "field1") == 5);
@@ -197,6 +197,8 @@ void arrays_of_structs_and_pointers_into_them()
197197
__CPROVER_set_field(q, "field2", 6);
198198
assert(__CPROVER_get_field(q, "field2") == 6);
199199

200+
int k;
201+
__CPROVER_assume(0 <= k && k < 3);
200202
int x;
201203
__CPROVER_assume(0 <= x && x < 3);
202204
__CPROVER_set_field(&(n[k].B1[x]), "field1", 46);
@@ -226,7 +228,7 @@ void dynamically_allocated_arrays_of_structs()
226228
assert(__CPROVER_get_field(&(u[1].B1[1]), "field2") == 3);
227229
assert(__CPROVER_get_field(&(p->B1[1]), "field2") == 4);
228230

229-
q = &(u[1].x1);
231+
int *q = &(u[1].x1);
230232
assert(__CPROVER_get_field(q, "field1") == 1);
231233
__CPROVER_set_field(q, "field1", 5);
232234
assert(__CPROVER_get_field(q, "field1") == 5);
@@ -236,6 +238,8 @@ void dynamically_allocated_arrays_of_structs()
236238
__CPROVER_set_field(q, "field2", 6);
237239
assert(__CPROVER_get_field(q, "field2") == 6);
238240

241+
int k;
242+
__CPROVER_assume(0 <= k && k < 3);
239243
int t;
240244
__CPROVER_assume(0 <= t && t < 3);
241245
__CPROVER_set_field(&(u[k].B1[t]), "field1", 46);

regression/cbmc-shadow-memory/global1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33

44
^EXIT=0$

0 commit comments

Comments
 (0)