diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-05-18 14:47:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-18 14:47:27 -0700 |
commit | 2ddb7cb1f45cf9aeef90ec5c8000a2d279f0302b (patch) | |
tree | 62106aee799d3ddc44aed87beb8442685ce8f307 /src/wasm-validator.h | |
parent | a5416d2a10490602beb49e5a356828111d229720 (diff) | |
download | binaryen-2ddb7cb1f45cf9aeef90ec5c8000a2d279f0302b.tar.gz binaryen-2ddb7cb1f45cf9aeef90ec5c8000a2d279f0302b.tar.bz2 binaryen-2ddb7cb1f45cf9aeef90ec5c8000a2d279f0302b.zip |
Address review feedback for #1014 (#1016)
* address review feedback for #1014
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r-- | src/wasm-validator.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h index 66375790c..699e5910a 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -43,6 +43,7 @@ #include "wasm.h" #include "wasm-printing.h" #include "ast_utils.h" +#include "ast/branch-utils.h" namespace wasm { @@ -230,8 +231,7 @@ public: } void visitBreak(Break *curr) { // note breaks (that are actually taken) - if ((!curr->value || curr->value->type != unreachable) && - (!curr->condition || curr->condition->type != unreachable)) { + if (BranchUtils::isBranchTaken(curr)) { noteBreak(curr->name, curr->value, curr); } if (curr->condition) { @@ -240,7 +240,7 @@ public: } void visitSwitch(Switch *curr) { // note breaks (that are actually taken) - if (curr->condition->type != unreachable && (!curr->value || curr->value->type != unreachable)) { + if (BranchUtils::isBranchTaken(curr)) { for (auto& target : curr->targets) { noteBreak(target, curr->value, curr); } |