summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuanzhong Chen <gzchen@google.com>2019-08-16 15:37:58 -0700
committerGitHub <noreply@github.com>2019-08-16 15:37:58 -0700
commit86b8cf6c299d0189d7819cf5eabb1ea03d34ff3a (patch)
tree42cd2d36fea839dd861cd0e525104edeb4875584 /src
parent42f98bc9937b76ae12574bdb01652d09034fdec4 (diff)
downloadbinaryen-86b8cf6c299d0189d7819cf5eabb1ea03d34ff3a.tar.gz
binaryen-86b8cf6c299d0189d7819cf5eabb1ea03d34ff3a.tar.bz2
binaryen-86b8cf6c299d0189d7819cf5eabb1ea03d34ff3a.zip
Fix infinite loop in AsmConstWalker::visitCall (#2303)
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm-emscripten.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index caea83302..978afa296 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -718,6 +718,12 @@ void AsmConstWalker::visitCall(Call* curr) {
if (set) {
assert(set->index == get->index);
arg = set->value;
+ } else {
+ Fatal() << "local.get of unknown in arg0 of call to " << import->base
+ << " (used by EM_ASM* macros) in function "
+ << getFunction()->name
+ << ".\nThis might be caused by aggressive compiler "
+ "transformations. Consider using EM_JS instead.";
}
} else if (auto* value = arg->dynCast<Binary>()) {
// In the dynamic linking case the address of the string constant
@@ -729,7 +735,7 @@ void AsmConstWalker::visitCall(Call* curr) {
} else {
if (!value) {
Fatal() << "Unexpected arg0 type (" << getExpressionName(arg)
- << ") in call to to: " << import->base;
+ << ") in call to: " << import->base;
}
}
}