@@ -228,7 +228,6 @@ class goto_check_ct
228
228
void conversion_check (const exprt &, const guardt &);
229
229
void float_overflow_check (const exprt &, const guardt &);
230
230
void nan_check (const exprt &, const guardt &);
231
- optionalt<exprt> expand_pointer_checks (exprt);
232
231
233
232
std::string array_name (const exprt &);
234
233
@@ -1992,62 +1991,6 @@ void goto_check_ct::check(const exprt &expr)
1992
1991
check_rec (expr, identity);
1993
1992
}
1994
1993
1995
- // / expand the r_ok, w_ok, rw_ok, pointer_in_range predicates
1996
- optionalt<exprt> goto_check_ct::expand_pointer_checks (exprt expr)
1997
- {
1998
- bool modified = false ;
1999
-
2000
- for (auto &op : expr.operands ())
2001
- {
2002
- auto op_result = expand_pointer_checks (op);
2003
- if (op_result.has_value ())
2004
- {
2005
- op = *op_result;
2006
- modified = true ;
2007
- }
2008
- }
2009
-
2010
- if (expr.id () == ID_r_ok || expr.id () == ID_w_ok || expr.id () == ID_rw_ok)
2011
- {
2012
- // these get an address as first argument and a size as second
2013
- DATA_INVARIANT (
2014
- expr.operands ().size () == 4 , " r/w_ok must have four operands" );
2015
-
2016
- const auto conditions = get_pointer_dereferenceable_conditions (
2017
- to_r_or_w_ok_expr (expr).pointer (), to_r_or_w_ok_expr (expr).size ());
2018
-
2019
- exprt::operandst conjuncts;
2020
-
2021
- for (const auto &c : conditions)
2022
- conjuncts.push_back (c.assertion );
2023
-
2024
- exprt c = conjunction (conjuncts);
2025
- if (enable_simplify)
2026
- simplify (c, ns);
2027
- return c;
2028
- }
2029
- else if (expr.id () == ID_pointer_in_range)
2030
- {
2031
- const auto &pointer_in_range_expr = to_pointer_in_range_expr (expr);
2032
-
2033
- auto expanded = pointer_in_range_expr.lower (ns);
2034
-
2035
- // rec. call
2036
- auto expanded_rec_opt = expand_pointer_checks (expanded);
2037
- if (expanded_rec_opt.has_value ())
2038
- expanded = *expanded_rec_opt;
2039
-
2040
- if (enable_simplify)
2041
- simplify (expanded, ns);
2042
-
2043
- return expanded;
2044
- }
2045
- else if (modified)
2046
- return std::move (expr);
2047
- else
2048
- return {};
2049
- }
2050
-
2051
1994
void goto_check_ct::memory_leak_check (const irep_idt &function_id)
2052
1995
{
2053
1996
const symbolt &leak = ns.lookup (CPROVER_PREFIX " memory_leak" );
@@ -2267,8 +2210,6 @@ void goto_check_ct::goto_check(
2267
2210
}
2268
2211
}
2269
2212
2270
- i.transform ([this ](exprt expr) { return expand_pointer_checks (expr); });
2271
-
2272
2213
for (auto &instruction : new_code.instructions )
2273
2214
{
2274
2215
if (instruction.source_location ().is_nil ())
0 commit comments