Skip to content

Commit 448e9fa

Browse files
lrytzretronym
authored andcommitted
[asm-cherry-pick] Associate LabelNodes with their corresponding label
It looks like this is a bugfix that should be handed upstream. Originally added in lrytz/scala@2458576
1 parent 14e9d3f commit 448e9fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/scala/tools/asm/tree/MethodNode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,10 @@ public void visitEnd() {
570570
*/
571571
protected LabelNode getLabelNode(final Label label) {
572572
if (!(label.info instanceof LabelNode)) {
573-
label.info = new LabelNode();
573+
// Patch in scala-asm: changed `new LabelNode()` to `new LabelNode(l)`
574+
// TODO: check if this can go upstream, or if it is still discouraged
575+
// https://mail.ow2.org/wws/arc/asm/2011-07/msg00032.html
576+
label.info = new LabelNode(label);
574577
}
575578
return (LabelNode) label.info;
576579
}

0 commit comments

Comments
 (0)