Skip to content

Commit fa1e3d2

Browse files
committed
Java checkcast: fix stack when check disabled
The checkcast instruction should always return the pointer it checked, even when we're not generating an assert in the case that it failed.
1 parent 85e7920 commit fa1e3d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,10 +980,11 @@ codet java_bytecode_convert_methodt::convert_instructions(
980980
c=code_assertt(check);
981981
c.add_source_location().set_comment("Dynamic cast check");
982982
c.add_source_location().set_property_class("bad-dynamic-cast");
983-
results[0]=op[0];
984983
}
985984
else
986985
c=code_skipt();
986+
987+
results[0]=op[0];
987988
}
988989
else if(statement=="invokedynamic")
989990
{

0 commit comments

Comments
 (0)