diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-06-24 13:06:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-24 13:06:00 -0700 |
commit | a88f8f275e068d6cdfb8879dc3bab1fe3201efbc (patch) | |
tree | 81a147693e4f65c025f11cafe6ee89b588106707 /src | |
parent | ed4e614430e8864c9f02508f5920c45fd137faf1 (diff) | |
download | binaryen-a88f8f275e068d6cdfb8879dc3bab1fe3201efbc.tar.gz binaryen-a88f8f275e068d6cdfb8879dc3bab1fe3201efbc.tar.bz2 binaryen-a88f8f275e068d6cdfb8879dc3bab1fe3201efbc.zip |
finalize blocks properly in relooper (#600)
Diffstat (limited to 'src')
-rw-r--r-- | src/cfg/Relooper.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cfg/Relooper.cpp b/src/cfg/Relooper.cpp index 06867c748..78b3f3e1c 100644 --- a/src/cfg/Relooper.cpp +++ b/src/cfg/Relooper.cpp @@ -55,6 +55,7 @@ wasm::Expression* Branch::Render(RelooperBuilder& Builder, Block *Target, bool S Ret->list.push_back(Builder.makeContinue(Ancestor->Id)); } } + Ret->finalize(); return Ret; } @@ -85,7 +86,10 @@ wasm::Expression* Block::Render(RelooperBuilder& Builder, bool InLoop) { } if (Code) Ret->list.push_back(Code); - if (!ProcessedBranchesOut.size()) return Ret; + if (!ProcessedBranchesOut.size()) { + Ret->finalize(); + return Ret; + } bool SetLabel = true; // in some cases it is clear we can avoid setting label, see later bool ForceSetLabel = Shape::IsEmulated(Parent) != nullptr; @@ -219,6 +223,8 @@ wasm::Expression* Block::Render(RelooperBuilder& Builder, bool InLoop) { Ret->list.push_back(Root); } + Ret->finalize(); + return Ret; } |