Skip to content

Commit 80d5419

Browse files
author
Enrico Steffinlongo
committed
Fix shadow memory local1 regression test
1 parent 5b0ddb7 commit 80d5419

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void arrays_and_pointers_into_arrays()
5353
{
5454
int A[5];
5555

56-
z = &(A[4]);
56+
int *z = &(A[4]);
5757

5858
assert(__CPROVER_get_field(z, "field1") == 0);
5959
assert(__CPROVER_get_field(z, "field2") == 0);
@@ -111,7 +111,7 @@ void structs_and_pointers_into_structs()
111111
__CPROVER_set_field(&(m.B1[j]), "field1", 44);
112112
assert(__CPROVER_get_field(&(m.B1[j]), "field1") == 44);
113113

114-
z = &(m.B1[j]);
114+
int *z = &(m.B1[j]);
115115
__CPROVER_set_field(z, "field1", 45);
116116
assert(__CPROVER_get_field(z, "field1") == 45);
117117
}
@@ -123,7 +123,7 @@ void arrays_of_structs_and_pointers_into_them()
123123
assert(__CPROVER_get_field(&(n[1].x1), "field1") == 0);
124124
assert(__CPROVER_get_field(&(n[1].B1[1]), "field2") == 0);
125125

126-
p = &(n[2]);
126+
struct STRUCTNAME *p = &(n[2]);
127127

128128
__CPROVER_set_field(&(n[1].x1), "field1", 1);
129129
__CPROVER_set_field(&(p->x1), "field1", 2);
@@ -135,7 +135,7 @@ void arrays_of_structs_and_pointers_into_them()
135135
assert(__CPROVER_get_field(&(n[1].B1[1]), "field2") == 3);
136136
assert(__CPROVER_get_field(&(p->B1[1]), "field2") == 4);
137137

138-
q = &(n[1].x1);
138+
int *q = &(n[1].x1);
139139
assert(__CPROVER_get_field(q, "field1") == 1);
140140
__CPROVER_set_field(q, "field1", 5);
141141
assert(__CPROVER_get_field(q, "field1") == 5);
@@ -147,10 +147,12 @@ void arrays_of_structs_and_pointers_into_them()
147147

148148
int k;
149149
__CPROVER_assume(0 <= k && k < 3);
150+
int j;
151+
__CPROVER_assume(0 <= j && j < 3);
150152
__CPROVER_set_field(&(n[k].B1[j]), "field1", 46);
151153
assert(__CPROVER_get_field(&(n[k].B1[j]), "field1") == 46);
152154

153-
z = &(n[k].B1[j]);
155+
int *z = &(n[k].B1[j]);
154156
__CPROVER_set_field(z, "field1", 47);
155157
assert(__CPROVER_get_field(z, "field1") == 47);
156158
}

regression/cbmc-shadow-memory/local1/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)