Wasm: fix debug info generation

This commit is contained in:
Alexey Andreev 2022-12-02 07:49:07 +01:00
parent 57e0227a02
commit 548ded7c75

View File

@ -943,15 +943,22 @@ class WasmBinaryRenderingVisitor implements WasmExpressionVisitor {
} }
private void emitLocation(TextLocation location) { private void emitLocation(TextLocation location) {
if (deferTextLocationToEmit && location != null) { if (deferTextLocationToEmit) {
if (location != null) {
textLocationToEmit = location; textLocationToEmit = location;
deferTextLocationToEmit = false;
} else {
return;
}
} }
flushLocation(); flushLocation();
textLocationToEmit = location; textLocationToEmit = location;
} }
private void emitDeferredLocation() { private void emitDeferredLocation() {
if (textLocationToEmit != null) {
flushLocation(); flushLocation();
}
textLocationToEmit = null; textLocationToEmit = null;
deferTextLocationToEmit = true; deferTextLocationToEmit = true;
} }