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