File tree 4 files changed +11
-25
lines changed
4 files changed +11
-25
lines changed Original file line number Diff line number Diff line change 1
1
CORE
2
2
main.c
3
- --signed-overflow-check --unsigned-overflow-check
3
+ --signed-overflow-check --unsigned-overflow-check --pointer-overflow-check --pointer-check --bounds-check
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 3
3
--pointer-overflow-check --unsigned-overflow-check
4
4
^EXIT=10$
5
5
^SIGNAL=0$
6
- ^\[main\.overflow \.\d+\] line 8 ( pointer )? arithmetic overflow on .*: FAILURE
7
- ^\[main\.overflow \.\d+\] line 9 ( pointer )? arithmetic overflow on .*: FAILURE
6
+ ^\[main\.pointer_arithmetic \.\d+\] line 8 pointer arithmetic: pointer outside dynamic object bounds in .*: FAILURE
7
+ ^\[main\.pointer_arithmetic \.\d+\] line 9 pointer arithmetic: pointer outside dynamic object bounds in .*: FAILURE
8
8
^\[main\.overflow\.\d+\] line 10 (pointer )?arithmetic overflow on .*: FAILURE
9
- ^\[main\.overflow\.\d+\] line 11 (pointer )?arithmetic overflow on .*: FAILURE
10
- ^\[main\.overflow\.\d+\] line 12 (pointer )?arithmetic overflow on .*: FAILURE
9
+ ^\[main\.pointer_arithmetic\.\d+\] line 10 pointer arithmetic: pointer outside dynamic object bounds in .*: FAILURE
10
+ ^\[main\.pointer_arithmetic\.\d+\] line 11 pointer arithmetic: pointer outside dynamic object bounds in .*: FAILURE
11
+ ^\[main\.pointer_arithmetic\.\d+\] line 12 pointer arithmetic: pointer outside dynamic object bounds in .*: FAILURE
11
12
^VERIFICATION FAILED$
12
13
--
13
14
^\[main\.overflow\.\d+\] line 1[45] (pointer )?arithmetic overflow on .*sizeof\(signed int\) .* : FAILURE
15
+ ^\[main\.overflow\.\d+\] line 1[45] pointer arithmetic: pointer outside dynamic object bounds in .*: FAILURE
14
16
^warning: ignoring
Original file line number Diff line number Diff line change 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 (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
6
+ \[main.pointer_arithmetic .1\] line \d+ pointer arithmetic: invalid integer address in p - \(signed long (long )?int\)1: SUCCESS
7
+ \[main.pointer_arithmetic .2\] line \d+ pointer arithmetic: invalid integer address in p \+ \(signed long (long )?int\)1: SUCCESS
8
+ \[main.pointer_arithmetic .3\] line \d+ pointer arithmetic: invalid integer address in p \+ \(signed long (long )?int\)-1: SUCCESS
9
+ \[main.pointer_arithmetic .4\] line \d+ pointer arithmetic: invalid integer address in p - \(signed long (long )?int\)-1: SUCCESS
10
10
--
11
11
^warning: ignoring
Original file line number Diff line number Diff line change @@ -1177,22 +1177,6 @@ void goto_checkt::pointer_overflow_check(
1177
1177
expr.operands ().size () == 2 ,
1178
1178
" pointer arithmetic expected to have exactly 2 operands" );
1179
1179
1180
- // check for address space overflow by checking for overflow on integers
1181
- exprt overflow (" overflow-" + expr.id_string (), bool_typet ());
1182
- for (const auto &op : expr.operands ())
1183
- {
1184
- overflow.add_to_operands (
1185
- typecast_exprt::conditional_cast (op, pointer_diff_type ()));
1186
- }
1187
-
1188
- add_guarded_property (
1189
- not_exprt (overflow),
1190
- " pointer arithmetic overflow on " + expr.id_string (),
1191
- " overflow" ,
1192
- expr.find_source_location (),
1193
- expr,
1194
- guard);
1195
-
1196
1180
// the result must be within object bounds or one past the end
1197
1181
const auto size = from_integer (0 , size_type ());
1198
1182
auto conditions = get_pointer_dereferenceable_conditions (expr, size);
You can’t perform that action at this time.
0 commit comments