Commit 7ff1aa63 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Fix code printing for anonymous functions

Anonymous functions have no index, thus we cannot get their source
position table.
Technically, we are not even allowed to call {index()} on anonymous
functions, as this will DCHECK that {index_} contains a value.

R=mstarzinger@chromium.org

Change-Id: I9a8b07cf836671e080cc1784c1712ecd88778972
Reviewed-on: https://chromium-review.googlesource.com/880921
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50802}
parent 8bfbe25a
......@@ -212,6 +212,8 @@ void WasmCode::Disassemble(const char* name, Isolate* isolate,
instructions().start() + instruction_size, nullptr);
os << "\n";
// Anonymous functions don't have source positions.
if (!IsAnonymous()) {
Object* source_positions_or_undef =
owner_->compiled_module()->source_positions()->get(index());
if (!source_positions_or_undef->IsUndefined(isolate)) {
......@@ -225,6 +227,7 @@ void WasmCode::Disassemble(const char* name, Isolate* isolate,
}
os << "\n";
}
}
os << "RelocInfo (size = " << reloc_size_ << ")\n";
for (RelocIterator it(instructions(), reloc_info(), constant_pool());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment