File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
regression/cbmc/Void_Pointer_Init Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+
3
+ void foo (void * arg )
4
+ {
5
+ assert (* (unsigned * )(arg ) == 5 );
6
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --function foo --pointer-check
4
+ ^\[foo.assertion.1\] line \d+ assertion \*\(unsigned \*\)\(arg\) == 5: FAILURE$
5
+ ^\[foo.pointer_dereference.4\] line \d+ dereference failure: dead object in \*\(\(unsigned int \*\)arg\): FAILURE$
6
+ ^EXIT=10$
7
+ ^SIGNAL=0$
8
+ ^VERIFICATION FAILED$
9
+ --
10
+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -1113,7 +1113,8 @@ void goto_checkt::pointer_validity_check(
1113
1113
const exprt &pointer=expr.pointer ();
1114
1114
1115
1115
auto size_of_expr_opt = size_of_expr (expr.type (), ns);
1116
- CHECK_RETURN (size_of_expr_opt.has_value ());
1116
+ if (!size_of_expr_opt.has_value ())
1117
+ return ; // in the case of `void*`
1117
1118
1118
1119
auto conditions = address_check (pointer, size_of_expr_opt.value ());
1119
1120
You can’t perform that action at this time.
0 commit comments