Skip to content

Commit 938d739

Browse files
smowtonpeterschrammel
authored andcommitted
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 dda9efb commit 938d739

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
@@ -1030,10 +1030,11 @@ codet java_bytecode_convert_methodt::convert_instructions(
10301030
c=code_assertt(check);
10311031
c.add_source_location().set_comment("Dynamic cast check");
10321032
c.add_source_location().set_property_class("bad-dynamic-cast");
1033-
results[0]=op[0];
10341033
}
10351034
else
10361035
c=code_skipt();
1036+
1037+
results[0]=op[0];
10371038
}
10381039
else if(statement=="invokedynamic")
10391040
{

0 commit comments

Comments
 (0)