From e5aaa07844687493e0155dacb6b79bf856a4dd81 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 18 Mar 2021 15:10:11 -0700 Subject: [Wasm GC] Fix MergeBlocks on BrOn (#3702) The pass was only aware of Break and Switch. Refactor it to use the generic code, so that we can first handle Break, and then if anything remains, note a problem was found. The same path can handle a Switch which we handled before and also a BrOn etc. git diff is not that useful after the refactoring sadly, but basically this just moves the Break code and the Drop code, then adds the BranchUtils::operateOn stuff after them (and we switch to a unified visitor so that we get called for all expressions). --- test/example/c-api-unused-mem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/example/c-api-unused-mem.cpp') diff --git a/test/example/c-api-unused-mem.cpp b/test/example/c-api-unused-mem.cpp index c540d15c1..2121d8bde 100644 --- a/test/example/c-api-unused-mem.cpp +++ b/test/example/c-api-unused-mem.cpp @@ -17,7 +17,7 @@ int main() { BinaryenModuleAutoDrop(the_module); { const char* segments[] = { 0 }; - bool segmentPassive[] = { false }; + bool segmentPassive[] = {false}; BinaryenExpressionRef segmentOffsets[] = { 0 }; BinaryenIndex segmentSizes[] = { 0 }; BinaryenSetMemory(the_module, 256, 256, "memory", segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0); @@ -60,7 +60,7 @@ int main() { BinaryenAddFunctionExport(the_module, "main", "main"); { const char* segments[] = { 0 }; - bool segmentPassive[] = { false }; + bool segmentPassive[] = {false}; BinaryenExpressionRef segmentOffsets[] = { 0 }; BinaryenIndex segmentSizes[] = { 0 }; BinaryenSetMemory(the_module, 1024, 1024, NULL, segments, segmentPassive, segmentOffsets, segmentSizes, 0, 0); -- cgit v1.2.3