Skip to content

Commit 8eac552

Browse files
committed
Rename allocs to more descriptive name
This is a Boolean expressions, and the name should convey this.
1 parent 92f3f4f commit 8eac552

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/analyses/goto_check.cpp

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -992,12 +992,16 @@ goto_checkt::address_check(const exprt &address, const exprt &size)
992992
alloc_disjuncts.push_back(and_exprt(lb_check, ub_check));
993993
}
994994

995-
const exprt allocs = disjunction(alloc_disjuncts);
995+
const exprt in_bounds_of_some_explicit_allocation =
996+
disjunction(alloc_disjuncts);
996997

997998
if(flags.is_unknown() || flags.is_null())
998999
{
9991000
conditions.push_back(conditiont(
1000-
or_exprt(allocs, not_exprt(null_pointer(address))), "pointer NULL"));
1001+
or_exprt(
1002+
in_bounds_of_some_explicit_allocation,
1003+
not_exprt(null_pointer(address))),
1004+
"pointer NULL"));
10011005
}
10021006

10031007
if(flags.is_unknown())
@@ -1010,21 +1014,28 @@ goto_checkt::address_check(const exprt &address, const exprt &size)
10101014
if(flags.is_uninitialized())
10111015
{
10121016
conditions.push_back(conditiont(
1013-
or_exprt(allocs, not_exprt(invalid_pointer(address))),
1017+
or_exprt(
1018+
in_bounds_of_some_explicit_allocation,
1019+
not_exprt(invalid_pointer(address))),
10141020
"pointer uninitialized"));
10151021
}
10161022

10171023
if(flags.is_unknown() || flags.is_dynamic_heap())
10181024
{
10191025
conditions.push_back(conditiont(
1020-
or_exprt(allocs, not_exprt(deallocated(address, ns))),
1026+
or_exprt(
1027+
in_bounds_of_some_explicit_allocation,
1028+
not_exprt(deallocated(address, ns))),
10211029
"deallocated dynamic object"));
10221030
}
10231031

10241032
if(flags.is_unknown() || flags.is_dynamic_local())
10251033
{
10261034
conditions.push_back(conditiont(
1027-
or_exprt(allocs, not_exprt(dead_object(address, ns))), "dead object"));
1035+
or_exprt(
1036+
in_bounds_of_some_explicit_allocation,
1037+
not_exprt(dead_object(address, ns))),
1038+
"dead object"));
10281039
}
10291040

10301041
if(flags.is_unknown() || flags.is_dynamic_heap())
@@ -1035,7 +1046,7 @@ goto_checkt::address_check(const exprt &address, const exprt &size)
10351046

10361047
conditions.push_back(conditiont(
10371048
or_exprt(
1038-
allocs,
1049+
in_bounds_of_some_explicit_allocation,
10391050
implies_exprt(
10401051
malloc_object(address, ns), not_exprt(dynamic_bounds_violation))),
10411052
"pointer outside dynamic object bounds"));
@@ -1051,7 +1062,7 @@ goto_checkt::address_check(const exprt &address, const exprt &size)
10511062

10521063
conditions.push_back(conditiont(
10531064
or_exprt(
1054-
allocs,
1065+
in_bounds_of_some_explicit_allocation,
10551066
implies_exprt(
10561067
not_exprt(dynamic_object(address)),
10571068
not_exprt(object_bounds_violation))),
@@ -1061,7 +1072,8 @@ goto_checkt::address_check(const exprt &address, const exprt &size)
10611072
if(flags.is_unknown() || flags.is_integer_address())
10621073
{
10631074
conditions.push_back(conditiont(
1064-
implies_exprt(integer_address(address), allocs),
1075+
implies_exprt(
1076+
integer_address(address), in_bounds_of_some_explicit_allocation),
10651077
"invalid integer address"));
10661078
}
10671079

0 commit comments

Comments
 (0)