Skip to content

Commit 1b097fd

Browse files
fix: StackOverflow on broken syntax
1 parent 1a4775e commit 1b097fd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

javasm-intellij-plugin/src/main/java/tokyo/peya/javasm/intellij/editor/linenumber/InstructionOffsetCalculator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ public static InstructionOffsetCalculator get(@NotNull MethodBodyNode methodNode
2626
return cached;
2727

2828
InstructionOffsetCalculator fresh = new InstructionOffsetCalculator();
29+
methodNode.putUserData(KEY, fresh);
2930
try {
3031
fresh.buildOffsets(methodNode);
3132
} catch (IllegalStateException ignored) {
3233
// これは,コードの記述が不完全だったり構文エラーのときにおきる。
34+
methodNode.putUserData(KEY, null);
3335
return fresh;
3436
}
35-
methodNode.putUserData(KEY, fresh);
3637
return fresh;
3738
}
3839

0 commit comments

Comments
 (0)