File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
regression/cbmc/pointer-overflow2 Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1- KNOWNBUG
1+ CORE
22main.c
33--pointer-overflow-check
44^EXIT=0$
55^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
1010--
1111^warning: ignoring
Original file line number Diff line number Diff line change @@ -1157,8 +1157,13 @@ void goto_checkt::pointer_overflow_check(
11571157 expr.operands ().size () == 2 ,
11581158 " pointer arithmetic expected to have exactly 2 operands" );
11591159
1160+ // check for address space overflow by checking for overflow on integers
11601161 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+ }
11621167
11631168 add_guarded_property (
11641169 not_exprt (overflow),
You can’t perform that action at this time.
0 commit comments