File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
regression/cbmc/integer-pointer Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <stdlib.h>
3
+
4
+ void main ()
5
+ {
6
+ char * p = malloc (1 );
7
+ __CPROVER_assume (__CPROVER_POINTER_OBJECT (p ) == 2 );
8
+ assert (0 ); // fails as expected
9
+
10
+ // same value as the malloc'd pointer above
11
+ char * q = (char * )((size_t )2 << sizeof (char * ) * 8 - 8 );
12
+
13
+ * p = 1 ;
14
+ * q = 2 ;
15
+
16
+ assert (* p == 1 ); // currently succeeds
17
+ }
Original file line number Diff line number Diff line change
1
+ KNOWNBUG
2
+ main.c
3
+ --pointer-check --no-simplify --no-propagation
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ \[main.assertion.1\] .*: FAILURE
7
+ \[main.assertion.2\] .*: FAILURE
8
+ --
9
+ ^warning: ignoring
10
+ --
11
+ The assertion should fail as q has the same value as p. However since q was
12
+ initialized via an integer literal it points into __CPROVER_memory, and not to
13
+ the malloced memory. Issue #5327.
You can’t perform that action at this time.
0 commit comments