Skip to content

Commit 47170bd

Browse files
author
Daniel Kroening
committed
bug related to pointers to members
1 parent 3831765 commit 47170bd

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

regression/cbmc/struct9/main.c

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
struct inner_struct {
2+
char *GUARDp;
3+
};
4+
5+
struct outer_struct {
6+
char GUARD;
7+
struct inner_struct inner;
8+
};
9+
10+
void foo(struct inner_struct *inner)
11+
{
12+
assert(*(inner->GUARDp) != 1);
13+
}
14+
15+
int main()
16+
{
17+
struct outer_struct outer;
18+
19+
outer.GUARD = 2;
20+
outer.inner.GUARDp = &outer.GUARD;
21+
22+
foo(&outer.inner);
23+
}

regression/cbmc/struct9/test.desc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWBUG
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring

0 commit comments

Comments
 (0)