@@ -201,12 +201,12 @@ class goto_checkt
201
201
// / \param guard: the condition under which the operation happens
202
202
void pointer_primitive_check (const exprt &expr, const guardt &guard);
203
203
204
- // / Returns true if the given expression is a pointer primitive such as
205
- // / __CPROVER_r_ok()
204
+ // / Returns true if the given expression is a pointer primitive
205
+ // / that requires a pointer primitive check
206
206
// /
207
207
// / \param expr expression
208
208
// / \return true if the given expression is a pointer primitive
209
- bool is_pointer_primitive (const exprt &expr);
209
+ bool requires_pointer_primitive_check (const exprt &expr);
210
210
211
211
optionalt<goto_checkt::conditiont>
212
212
get_pointer_is_null_condition (const exprt &address, const exprt &size);
@@ -1282,10 +1282,7 @@ void goto_checkt::pointer_primitive_check(
1282
1282
if (expr.source_location ().is_built_in ())
1283
1283
return ;
1284
1284
1285
- const exprt pointer =
1286
- (expr.id () == ID_r_ok || expr.id () == ID_w_ok || expr.id () == ID_rw_ok)
1287
- ? to_r_or_w_ok_expr (expr).pointer ()
1288
- : to_unary_expr (expr).op ();
1285
+ const exprt pointer = to_unary_expr (expr).op ();
1289
1286
1290
1287
CHECK_RETURN (pointer.type ().id () == ID_pointer);
1291
1288
@@ -1317,15 +1314,13 @@ void goto_checkt::pointer_primitive_check(
1317
1314
}
1318
1315
}
1319
1316
1320
- bool goto_checkt::is_pointer_primitive (const exprt &expr)
1317
+ bool goto_checkt::requires_pointer_primitive_check (const exprt &expr)
1321
1318
{
1322
1319
// we don't need to include the __CPROVER_same_object primitive here as it
1323
1320
// is replaced by lower level primitives in the special function handling
1324
1321
// during typechecking (see c_typecheck_expr.cpp)
1325
1322
return expr.id () == ID_pointer_object || expr.id () == ID_pointer_offset ||
1326
- expr.id () == ID_object_size || expr.id () == ID_r_ok ||
1327
- expr.id () == ID_w_ok || expr.id () == ID_rw_ok ||
1328
- expr.id () == ID_is_dynamic_object;
1323
+ expr.id () == ID_object_size || expr.id () == ID_is_dynamic_object;
1329
1324
}
1330
1325
1331
1326
goto_checkt::conditionst goto_checkt::get_pointer_dereferenceable_conditions (
@@ -1795,7 +1790,7 @@ void goto_checkt::check_rec(const exprt &expr, guardt &guard)
1795
1790
{
1796
1791
pointer_validity_check (to_dereference_expr (expr), expr, guard);
1797
1792
}
1798
- else if (is_pointer_primitive (expr))
1793
+ else if (requires_pointer_primitive_check (expr))
1799
1794
{
1800
1795
pointer_primitive_check (expr, guard);
1801
1796
}
0 commit comments