diff options
author | Alon Zakai (kripken) <alonzakai@gmail.com> | 2017-05-28 11:26:58 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2017-06-01 13:18:19 -0700 |
commit | ed21d9ce96f51851a4fa357804f58972f4b66284 (patch) | |
tree | 1ba4cdaf091b96813452946722876ad11f18f4b3 /src/wasm-validator.h | |
parent | 9b3594b4c704d8562b583da7f27711373ff17f3c (diff) | |
download | binaryen-ed21d9ce96f51851a4fa357804f58972f4b66284.tar.gz binaryen-ed21d9ce96f51851a4fa357804f58972f4b66284.tar.bz2 binaryen-ed21d9ce96f51851a4fa357804f58972f4b66284.zip |
error if select sides are concrete but different
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r-- | src/wasm-validator.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h index 947a741d8..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) { |