diff options
author | jgravelle-google <jgravelle@google.com> | 2016-10-27 10:56:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-27 10:56:11 -0700 |
commit | 82639c7c658f4335850fe290f4cd6b34f3fb91f5 (patch) | |
tree | e6777143ff8a5c0cdb63f276d33457ca28a9fe3f /src | |
parent | afad1ee305719cf2a34b6dcccff72b07e1a5e34d (diff) | |
download | binaryen-82639c7c658f4335850fe290f4cd6b34f3fb91f5.tar.gz binaryen-82639c7c658f4335850fe290f4cd6b34f3fb91f5.tar.bz2 binaryen-82639c7c658f4335850fe290f4cd6b34f3fb91f5.zip |
Set the type of the implicit blocks we use for a loop body in s2wasm (#810)
Loops are modeled in Binaryen IR as having a Block as a body. The block
is added to module walkers and validated like a normal block.
In s2wasm when we add the blocks, we need to make sure that the type of
the loop body matches the type of the loop itself, or we run into
issues.
Diffstat (limited to 'src')
-rw-r--r-- | src/s2wasm.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index 1e52cfbce..c5b502c6d 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -1129,6 +1129,7 @@ class S2WasmBuilder { curr->name = getNextLabel(); auto implicitBlock = allocator->alloc<Block>(); curr->body = implicitBlock; + implicitBlock->type = loopType; bstack.push_back(curr); } else if (match("end_loop")) { auto* loop = bstack.back()->cast<Loop>(); |