Skip to content

Commit d48b073

Browse files
committed
Only try to materialize instrumentable functions that have debug info.
(cherry picked from commit a603f8a)
1 parent f923fd3 commit d48b073

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/nodes/WasmInstrumentableFunctionNode.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,17 @@ public InstrumentableNode materializeInstrumentableNodes(Set<Class<? extends Tag
163163
// We need to check if linking is completed. Else the call nodes might not have been
164164
// resolved yet.
165165
WasmContext context = WasmContext.get(this);
166-
if (info == null && materializedTags.contains(StandardTags.StatementTag.class)) {
166+
if (info == null && module.hasDebugInfo() && materializedTags.contains(StandardTags.StatementTag.class)) {
167167
Lock lock = getLock();
168168
lock.lock();
169169
try {
170170
info = this.instrumentation;
171171
if (info == null) {
172172
final int functionIndex = codeEntry.functionIndex();
173-
final DebugFunction debugFunction = module.debugFunctions(this).get(functionSourceLocation);
173+
final DebugFunction debugFunction = debugFunction();
174+
if (debugFunction == null) {
175+
return this;
176+
}
174177
this.instrumentation = info = insert(new WasmInstrumentationSupportNode(debugFunction, module, functionIndex));
175178
final BinaryParser binaryParser = new BinaryParser(module, context, module.codeSection());
176179
final byte[] bytecode = binaryParser.createFunctionDebugBytecode(functionIndex, debugFunction.lineMap().sourceLocationToLineMap());

0 commit comments

Comments
 (0)