Skip to content

Commit 7181397

Browse files
Cleanup invariants in remove_function_pointers
1 parent a78db8c commit 7181397

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/goto-programs/remove_function_pointers.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void remove_function_pointerst::remove_function_pointer(
281281
const code_function_callt &code=
282282
to_code_function_call(target->code);
283283

284-
const exprt &function=code.function();
284+
const auto &function = to_dereference_expr(code.function());
285285

286286
// this better have the right type
287287
code_typet call_type=to_code_type(function.type());
@@ -296,12 +296,9 @@ void remove_function_pointerst::remove_function_pointer(
296296
code_typet::parametert(it->type()));
297297
}
298298

299-
assert(function.id()==ID_dereference);
300-
assert(function.operands().size()==1);
301-
302299
bool found_functions;
303300

304-
const exprt &pointer=function.op0();
301+
const exprt &pointer = function.pointer();
305302
remove_const_function_pointerst::functionst functions;
306303
does_remove_constt const_removal_check(goto_program, ns);
307304
const auto does_remove_const = const_removal_check();

0 commit comments

Comments
 (0)