Commit f2062511 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Fix start merge arity of function block

This value was uninitialized before. Initialize it to zero. Also, fix
the tracing output to actually print the start arity and not the end
arity.

R=rossberg@chromium.org

Change-Id: I1eda3be88ca842f60e40e3fb630eca254619ae83
Reviewed-on: https://chromium-review.googlesource.com/756702Reviewed-by: 's avatarAndreas Rossberg <rossberg@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49176}
parent b2c319a2
......@@ -1283,6 +1283,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
// Set up initial function block.
{
auto* c = PushBlock();
InitMerge(&c->start_merge, 0, [](uint32_t) -> Value { UNREACHABLE(); });
InitMerge(&c->end_merge,
static_cast<uint32_t>(this->sig_->return_count()),
[&] (uint32_t i) {
......@@ -1799,7 +1800,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
default:
break;
}
if (c.start_merge.arity) PrintF("%u-", c.end_merge.arity);
if (c.start_merge.arity) PrintF("%u-", c.start_merge.arity);
PrintF("%u", c.end_merge.arity);
if (!c.reachable()) PrintF("%c", c.unreachable() ? '*' : '#');
}
......
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