File tree 2 files changed +11
-6
lines changed
regression/cbmc/pointer-overflow2
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
- KNOWNBUG
1
+ CORE
2
2
main.c
3
3
--pointer-overflow-check
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
- \[main.overflow.1\] line \d+ pointer arithmetic overflow on - in p - \(signed long int\)1: SUCCESS
7
- \[main.overflow.2\] line \d+ pointer arithmetic overflow on \+ in p \+ \(signed long int\)1: SUCCESS
8
- \[main.overflow.3\] line \d+ pointer arithmetic overflow on \+ in p \+ \(signed long int\)-1: SUCCESS
9
- \[main.overflow.4\] line \d+ pointer arithmetic overflow on - in p - \(signed long int\)-1: SUCCESS
6
+ \[main.overflow.1\] line \d+ pointer arithmetic overflow on - in p - \(signed long (long )? int\)1: SUCCESS
7
+ \[main.overflow.2\] line \d+ pointer arithmetic overflow on \+ in p \+ \(signed long (long )? int\)1: SUCCESS
8
+ \[main.overflow.3\] line \d+ pointer arithmetic overflow on \+ in p \+ \(signed long (long )? int\)-1: SUCCESS
9
+ \[main.overflow.4\] line \d+ pointer arithmetic overflow on - in p - \(signed long (long )? int\)-1: SUCCESS
10
10
--
11
11
^warning: ignoring
Original file line number Diff line number Diff line change @@ -1157,8 +1157,13 @@ void goto_checkt::pointer_overflow_check(
1157
1157
expr.operands ().size () == 2 ,
1158
1158
" pointer arithmetic expected to have exactly 2 operands" );
1159
1159
1160
+ // check for address space overflow by checking for overflow on integers
1160
1161
exprt overflow (" overflow-" + expr.id_string (), bool_typet ());
1161
- overflow.operands () = expr.operands ();
1162
+ for (const auto &op : expr.operands ())
1163
+ {
1164
+ overflow.add_to_operands (
1165
+ typecast_exprt::conditional_cast (op, pointer_diff_type ()));
1166
+ }
1162
1167
1163
1168
add_guarded_property (
1164
1169
not_exprt (overflow),
You can’t perform that action at this time.
0 commit comments