Skip to content

Commit 4692ac1

Browse files
committed
remove goto_check_javat::bounds_check_bit_count
The Java front-end does not offer a bit count operator, and thus, this check is redundant.
1 parent a1472ae commit 4692ac1

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/analyses/goto_check_java.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ class goto_check_javat
163163

164164
void bounds_check(const exprt &, const guardt &);
165165
void bounds_check_index(const index_exprt &, const guardt &);
166-
void bounds_check_bit_count(const unary_exprt &, const guardt &);
167166
void div_by_zero_check(const div_exprt &, const guardt &);
168167
void mod_overflow_check(const mod_exprt &, const guardt &);
169168
void undefined_shift_check(const shift_exprt &, const guardt &);
@@ -1069,11 +1068,6 @@ void goto_check_javat::bounds_check(const exprt &expr, const guardt &guard)
10691068

10701069
if(expr.id() == ID_index)
10711070
bounds_check_index(to_index_expr(expr), guard);
1072-
else if(
1073-
expr.id() == ID_count_leading_zeros || expr.id() == ID_count_trailing_zeros)
1074-
{
1075-
bounds_check_bit_count(to_unary_expr(expr), guard);
1076-
}
10771071
}
10781072

10791073
void goto_check_javat::bounds_check_index(
@@ -1218,28 +1212,6 @@ void goto_check_javat::bounds_check_index(
12181212
}
12191213
}
12201214

1221-
void goto_check_javat::bounds_check_bit_count(
1222-
const unary_exprt &expr,
1223-
const guardt &guard)
1224-
{
1225-
std::string name;
1226-
1227-
if(expr.id() == ID_count_leading_zeros)
1228-
name = "leading";
1229-
else if(expr.id() == ID_count_trailing_zeros)
1230-
name = "trailing";
1231-
else
1232-
PRECONDITION(false);
1233-
1234-
add_guarded_property(
1235-
notequal_exprt{expr.op(), from_integer(0, expr.op().type())},
1236-
"count " + name + " zeros is undefined for value zero",
1237-
"bit count",
1238-
expr.find_source_location(),
1239-
expr,
1240-
guard);
1241-
}
1242-
12431215
void goto_check_javat::add_guarded_property(
12441216
const exprt &asserted_expr,
12451217
const std::string &comment,
@@ -1479,11 +1451,6 @@ void goto_check_javat::check_rec(const exprt &expr, guardt &guard)
14791451
{
14801452
pointer_validity_check(to_dereference_expr(expr), expr, guard);
14811453
}
1482-
else if(
1483-
expr.id() == ID_count_leading_zeros || expr.id() == ID_count_trailing_zeros)
1484-
{
1485-
bounds_check(expr, guard);
1486-
}
14871454
}
14881455

14891456
void goto_check_javat::check(const exprt &expr)

0 commit comments

Comments
 (0)