Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPD with GOTO #30

Open
mikevoronov opened this issue Aug 11, 2019 · 1 comment
Open

NPD with GOTO #30

mikevoronov opened this issue Aug 11, 2019 · 1 comment

Comments

@mikevoronov
Copy link

mikevoronov commented Aug 11, 2019

I have stumbled with NPD during compilation of this example. It seems that this exception caused by generation of stack locals after GOTO operation: the field locals sets to null by asm after GOTO and then processing of iconst_1 operation tries to invoke get on null object here

localsRead.put(var, locals.get(var));

The stack trace is

visitVarInsn:334, Splitter$StackAndLocalTrackingAdapter (asmble.compile.jvm.msplit)
accept:74, VarInsnNode (org.objectweb.asm.tree)
splitPointFromInfo:267, Splitter$Iter (asmble.compile.jvm.msplit)
longestForCurrIndex:152, Splitter$Iter (asmble.compile.jvm.msplit)
nextOrNull:129, Splitter$Iter (asmble.compile.jvm.msplit)
hasNext:107, Splitter$Iter (asmble.compile.jvm.msplit)
split:52, SplitMethod (asmble.compile.jvm.msplit)
split:31, SplitMethod (asmble.compile.jvm.msplit)
fromClassNode:32, AsmToBinary (asmble.compile.jvm)
fromClassNode$default:16, AsmToBinary (asmble.compile.jvm)
run:72, Compile (asmble.cli)
run:10, Compile (asmble.cli)
runWithArgs:17, Command (asmble.cli)
main:35, MainKt (asmble.cli)

Also tested with the latest asm - the same result.

@cretz
Copy link
Owner

cretz commented Aug 11, 2019

Hrmm, haven't been able to revisit this project in a bit. A reduced test case would be ideal. But in general I can't promise a time when I'll get to investigating this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants