summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-08-12 09:32:09 -0700
committerGitHub <noreply@github.com>2021-08-12 09:32:09 -0700
commit18022894adb20cec9dc7ef87464180eb26881266 (patch)
tree968e1fbe0d450c3879bbfcb694493828bcb00fbd /src
parentb84d2cf5491cabdeac565dcd9695d1673037f7e9 (diff)
downloadbinaryen-18022894adb20cec9dc7ef87464180eb26881266.tar.gz
binaryen-18022894adb20cec9dc7ef87464180eb26881266.tar.bz2
binaryen-18022894adb20cec9dc7ef87464180eb26881266.zip
Fix the Switch operand order in LinearExecutionWalker (#4076)
This caused no noticeable bugs, but it could in theory in new passes - in fact in a pass I will open later this week it did. Also fix the order in wasm.h. That part has no effect, but it is nice to be consistent. After this PR, everything should match the single source of truth which is wasm-delegations-fields.h (as that is used in printing, binary reading/writing, etc., so it has to be correct). Also Switch now matches the ordering in Break.
Diffstat (limited to 'src')
-rw-r--r--src/ir/linear-execution.h2
-rw-r--r--src/wasm.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/ir/linear-execution.h b/src/ir/linear-execution.h
index a37349489..230bafee5 100644
--- a/src/ir/linear-execution.h
+++ b/src/ir/linear-execution.h
@@ -87,8 +87,8 @@ struct LinearExecutionWalker : public PostWalker<SubType, VisitorType> {
case Expression::Id::SwitchId: {
self->pushTask(SubType::doVisitSwitch, currp);
self->pushTask(SubType::doNoteNonLinear, currp);
- self->maybePushTask(SubType::scan, &curr->cast<Switch>()->value);
self->pushTask(SubType::scan, &curr->cast<Switch>()->condition);
+ self->maybePushTask(SubType::scan, &curr->cast<Switch>()->value);
break;
}
case Expression::Id::ReturnId: {
diff --git a/src/wasm.h b/src/wasm.h
index e673a4c71..00de04623 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -799,8 +799,8 @@ public:
ArenaVector<Name> targets;
Name default_;
- Expression* condition = nullptr;
Expression* value = nullptr;
+ Expression* condition = nullptr;
void finalize();
};