diff --git a/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderingVisitor.java b/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderingVisitor.java index 52a81b38b..0381543ce 100644 --- a/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderingVisitor.java +++ b/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderingVisitor.java @@ -985,7 +985,7 @@ class WasmBinaryRenderingVisitor implements WasmExpressionVisitor { private void doEmitLocation() { var address = positionToEmit + addressOffset; if (dwarfGenerator != null) { - if (textLocationToEmit == null) { + if (textLocationToEmit == null || textLocationToEmit.getFileName() == null) { dwarfGenerator.endLineNumberSequence(address); } else { dwarfGenerator.lineNumber(address, textLocationToEmit.getFileName(), textLocationToEmit.getLine()); @@ -1010,7 +1010,7 @@ class WasmBinaryRenderingVisitor implements WasmExpressionVisitor { methodStack.remove(methodStack.size() - 1); } while (commonPart < currentMethodStack.size()) { - var method = currentMethodStack.get(commonPart); + var method = currentMethodStack.get(commonPart++); methodStack.add(method); debugLines.start(method); }