diff options
author | Guanzhong Chen <gzchen@google.com> | 2019-08-16 15:37:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-16 15:37:58 -0700 |
commit | 86b8cf6c299d0189d7819cf5eabb1ea03d34ff3a (patch) | |
tree | 42cd2d36fea839dd861cd0e525104edeb4875584 /src | |
parent | 42f98bc9937b76ae12574bdb01652d09034fdec4 (diff) | |
download | binaryen-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.cpp | 8 |
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; } } } |