summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-05-21 08:07:56 -0700
committerGitHub <noreply@github.com>2017-05-21 08:07:56 -0700
commit21cb9e8fa9f12680df0a25d969c935c79b388d3e (patch)
treee26a0fd5865003a7a18ab8735ff6411fc2bf465f /src/wasm-validator.h
parent9e0958982d2044949746c2d8290dbc0368546ebf (diff)
parent026accbe55dde6b9d769292195c3ad1ac0a3b8b0 (diff)
downloadbinaryen-21cb9e8fa9f12680df0a25d969c935c79b388d3e.tar.gz
binaryen-21cb9e8fa9f12680df0a25d969c935c79b388d3e.tar.bz2
binaryen-21cb9e8fa9f12680df0a25d969c935c79b388d3e.zip
Merge pull request #1019 from WebAssembly/fuzz
More fuzz bug fixes
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r--src/wasm-validator.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 699e5910a..aa404099e 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -408,17 +408,26 @@ public:
switch (curr->op) {
case ClzInt32:
case CtzInt32:
- case PopcntInt32:
+ case PopcntInt32: {
+ shouldBeEqual(curr->value->type, i32, curr, "i32 unary value type must be correct");
+ break;
+ }
+ case ClzInt64:
+ case CtzInt64:
+ case PopcntInt64: {
+ shouldBeEqual(curr->value->type, i64, curr, "i64 unary value type must be correct");
+ break;
+ }
case NegFloat32:
case AbsFloat32:
case CeilFloat32:
case FloorFloat32:
case TruncFloat32:
case NearestFloat32:
- case SqrtFloat32:
- case ClzInt64:
- case CtzInt64:
- case PopcntInt64:
+ case SqrtFloat32: {
+ shouldBeEqual(curr->value->type, f32, curr, "f32 unary value type must be correct");
+ break;
+ }
case NegFloat64:
case AbsFloat64:
case CeilFloat64:
@@ -426,7 +435,7 @@ public:
case TruncFloat64:
case NearestFloat64:
case SqrtFloat64: {
- shouldBeEqual(curr->value->type, curr->type, curr, "non-conversion unaries must return the same type");
+ shouldBeEqual(curr->value->type, f64, curr, "f64 unary value type must be correct");
break;
}
case EqZInt32: {