summaryrefslogtreecommitdiff
path: root/src/wasm-validator.h
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-06-29 13:28:03 -0700
committerGitHub <noreply@github.com>2016-06-29 13:28:03 -0700
commitb7420eb7b37a589c7fc2fb3a59d91a36c19e6dcb (patch)
tree265c27c20aa857d71daa450510613e16264ea88e /src/wasm-validator.h
parent04fa143e85bc870c80c50aa57cdbce833df0aa2d (diff)
parentb3cd0621ff58d6a6e02c77ab29caa6efec097988 (diff)
downloadbinaryen-b7420eb7b37a589c7fc2fb3a59d91a36c19e6dcb.tar.gz
binaryen-b7420eb7b37a589c7fc2fb3a59d91a36c19e6dcb.tar.bz2
binaryen-b7420eb7b37a589c7fc2fb3a59d91a36c19e6dcb.zip
Merge pull request #611 from WebAssembly/updates
Updates
Diffstat (limited to 'src/wasm-validator.h')
-rw-r--r--src/wasm-validator.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 76e142725..ac8cac410 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -98,7 +98,9 @@ public:
if (!shouldBeTrue(!!target, curr, "call target must exist")) return;
if (!shouldBeTrue(curr->operands.size() == target->params.size(), curr, "call param number must match")) return;
for (size_t i = 0; i < curr->operands.size(); i++) {
- shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, target->params[i], curr, "call param types must match");
+ if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, target->params[i], curr, "call param types must match")) {
+ std::cerr << "(on argument " << i << ")\n";
+ }
}
}
void visitCallImport(CallImport *curr) {
@@ -107,7 +109,9 @@ public:
auto* type = import->type;
if (!shouldBeTrue(curr->operands.size() == type->params.size(), curr, "call param number must match")) return;
for (size_t i = 0; i < curr->operands.size(); i++) {
- shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, type->params[i], curr, "call param types must match");
+ if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, type->params[i], curr, "call param types must match")) {
+ std::cerr << "(on argument " << i << ")\n";
+ }
}
}
void visitCallIndirect(CallIndirect *curr) {
@@ -116,7 +120,9 @@ public:
shouldBeEqualOrFirstIsUnreachable(curr->target->type, i32, curr, "indirect call target must be an i32");
if (!shouldBeTrue(curr->operands.size() == type->params.size(), curr, "call param number must match")) return;
for (size_t i = 0; i < curr->operands.size(); i++) {
- shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, type->params[i], curr, "call param types must match");
+ if (!shouldBeEqualOrFirstIsUnreachable(curr->operands[i]->type, type->params[i], curr, "call param types must match")) {
+ std::cerr << "(on argument " << i << ")\n";
+ }
}
}
void visitSetLocal(SetLocal *curr) {