summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-06-01 18:45:26 -0700
committerGitHub <noreply@github.com>2017-06-01 18:45:26 -0700
commit6611f548cc1e6b373693cde09e9a7379659e8832 (patch)
treeeb1565a85ee751d1ebc52673916d62d17ef44e36 /src/wasm-validator.h
parent0dc07eaa7db35cf65edbbccebe5c89b995613745 (diff)
parentbd001c187b90a570ce8babaad83af3b420f48eb5 (diff)
downloadbinaryen-6611f548cc1e6b373693cde09e9a7379659e8832.tar.gz
binaryen-6611f548cc1e6b373693cde09e9a7379659e8832.tar.bz2
binaryen-6611f548cc1e6b373693cde09e9a7379659e8832.zip
Merge pull request #1033 from WebAssembly/fuzz2
More misc fuzz fixes
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r--src/wasm-validator.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 1b704101d..d14a56a10 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -478,6 +478,9 @@ public:
shouldBeUnequal(curr->ifTrue->type, none, curr, "select left must be valid");
shouldBeUnequal(curr->ifFalse->type, none, curr, "select right must be valid");
shouldBeTrue(curr->condition->type == unreachable || curr->condition->type == i32, curr, "select condition must be valid");
+ if (curr->ifTrue->type != unreachable && curr->ifFalse->type != unreachable) {
+ shouldBeEqual(curr->ifTrue->type, curr->ifFalse->type, curr, "select sides must be equal");
+ }
}
void visitDrop(Drop* curr) {
@@ -772,7 +775,7 @@ public:
// The block has an added type, not derived from the ast itself, so it is
// ok for it to be either i32 or unreachable.
if (!(isConcreteWasmType(oldType) && newType == unreachable)) {
- parent.fail() << "stale type found in " << getFunction()->name << " on " << curr << "\n(marked as " << printWasmType(oldType) << ", should be " << printWasmType(newType) << ")\n";
+ parent.fail() << "stale type found in " << (getFunction() ? getFunction()->name : Name("(global scope)")) << " on " << curr << "\n(marked as " << printWasmType(oldType) << ", should be " << printWasmType(newType) << ")\n";
parent.valid = false;
}
curr->type = oldType;