Skip to content

Commit

Permalink
BL-926 Fix do while in psuedo constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeers committed Jan 14, 2025
1 parent 3739e95 commit 0321afa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,12 @@ public List<AbstractInsnNode> transform( BoxNode node, TransformerContext contex
nodes.add( new InsnNode( Opcodes.ARETURN ) );
return AsmHelper.addLineNumberLabels( nodes, node );
} else if ( exitsAllowed.equals( ExitsAllowed.LOOP ) ) {
// template = "if(true) break " + breakLabel + ";";
nodes.add( new InsnNode( Opcodes.ARETURN ) );
nodes.add( new InsnNode( transpiler.canReturn() ? Opcodes.ARETURN : Opcodes.RETURN ) );
return AsmHelper.addLineNumberLabels( nodes, node );
} else if ( exitsAllowed.equals( ExitsAllowed.FUNCTION ) ) {
nodes.add( new InsnNode( Opcodes.ARETURN ) );
return AsmHelper.addLineNumberLabels( nodes, node );
} else {
// template = "if(true) return;";
}
// if ( currentBreak == null ) {
// throw new RuntimeException( "Cannot break from current location" );
// }

throw new RuntimeException( "Cannot break from current location" );

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/TestCases/phase3/ClassTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1646,10 +1646,10 @@ public void testPropertiesNotInheritedInMetadata() {
}

@Test
@Disabled( "BL-926" )
public void testUserASMError() {
instance.executeSource(
"""
new src.test.java.TestCases.phase3.ASMError()
""",
context );
Expand Down

0 comments on commit 0321afa

Please sign in to comment.