Skip to content

Commit 9360f74

Browse files
committed
Add regression test for object accessed through integer pointer
1 parent 03ab5c7 commit 9360f74

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <assert.h>
2+
#include <stdlib.h>
3+
4+
void main()
5+
{
6+
char *p = malloc(1);
7+
assert(__CPROVER_POINTER_OBJECT(p) == 2);
8+
9+
// same value as the malloc'd pointer above
10+
char *q = (char *)((size_t)2 << sizeof(char *) * 8 - 8);
11+
12+
*p = 1;
13+
*q = 2;
14+
15+
assert(*p == 1); // currently succeeds
16+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
KNOWNBUG
2+
main.c
3+
--pointer-check --no-simplify --no-propagation
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring

0 commit comments

Comments
 (0)