Skip to content

Commit 870e7ff

Browse files
committed
Remove needless typecast
1 parent 2662cad commit 870e7ff

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/java_bytecode/java_bytecode_instrument.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,9 @@ codet java_bytecode_instrumentt::check_null_dereference(
274274
const source_locationt &original_loc,
275275
const bool assertion_enabled)
276276
{
277-
exprt local_expr=expr;
278-
empty_typet voidt;
279-
pointer_typet voidptr(voidt);
280-
281-
if(local_expr.type()!=voidptr)
282-
local_expr.make_typecast(voidptr);
283-
284277
const equal_exprt equal_expr(
285-
local_expr,
286-
null_pointer_exprt(voidptr));
278+
expr,
279+
null_pointer_exprt(to_pointer_type(expr.type())));
287280

288281
if(throw_runtime_exceptions)
289282
return throw_exception(

0 commit comments

Comments
 (0)