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 @@ -1181,22 +1181,6 @@ void goto_checkt::pointer_overflow_check(
1181
1181
expr.operands ().size () == 2 ,
1182
1182
" pointer arithmetic expected to have exactly 2 operands" );
1183
1183
1184
- // check for address space overflow by checking for overflow on integers
1185
- exprt overflow (" overflow-" + expr.id_string (), bool_typet ());
1186
- for (const auto &op : expr.operands ())
1187
- {
1188
- overflow.add_to_operands (
1189
- typecast_exprt::conditional_cast (op, pointer_diff_type ()));
1190
- }
1191
-
1192
- add_guarded_property (
1193
- not_exprt (overflow),
1194
- " pointer arithmetic overflow on " + expr.id_string (),
1195
- " overflow" ,
1196
- expr.find_source_location (),
1197
- expr,
1198
- guard);
1199
-
1200
1184
// the result must be within object bounds or one past the end
1201
1185
const auto size = from_integer (0 , size_type ());
1202
1186
auto conditions = get_pointer_dereferenceable_conditions (expr, size);
You can’t perform that action at this time.
0 commit comments