summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2017-05-25 10:43:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2017-06-01 13:16:53 -0700
commitadbb5e5c4469d720c4804d5825719cf57b9f18c8 (patch)
tree205c1c82de912267735efe594da4a45d40dd79db
parent0dc07eaa7db35cf65edbbccebe5c89b995613745 (diff)
downloadbinaryen-adbb5e5c4469d720c4804d5825719cf57b9f18c8.tar.gz
binaryen-adbb5e5c4469d720c4804d5825719cf57b9f18c8.tar.bz2
binaryen-adbb5e5c4469d720c4804d5825719cf57b9f18c8.zip
in extra pass-debug validation, don't assume there is always a function, the error may be in a global init
-rw-r--r--src/wasm-validator.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm-validator.h b/src/wasm-validator.h
index 1b704101d..947a741d8 100644
--- a/src/wasm-validator.h
+++ b/src/wasm-validator.h
@@ -772,7 +772,7 @@ public:
// The block has an added type, not derived from the ast itself, so it is
// ok for it to be either i32 or unreachable.
if (!(isConcreteWasmType(oldType) && newType == unreachable)) {
- parent.fail() << "stale type found in " << getFunction()->name << " on " << curr << "\n(marked as " << printWasmType(oldType) << ", should be " << printWasmType(newType) << ")\n";
+ parent.fail() << "stale type found in " << (getFunction() ? getFunction()->name : Name("(global scope)")) << " on " << curr << "\n(marked as " << printWasmType(oldType) << ", should be " << printWasmType(newType) << ")\n";
parent.valid = false;
}
curr->type = oldType;