summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-05-18 14:47:27 -0700
committerGitHub <noreply@github.com>2017-05-18 14:47:27 -0700
commit2ddb7cb1f45cf9aeef90ec5c8000a2d279f0302b (patch)
tree62106aee799d3ddc44aed87beb8442685ce8f307 /src/wasm-validator.h
parenta5416d2a10490602beb49e5a356828111d229720 (diff)
downloadbinaryen-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.h6
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);
}