From 3334c090c73f861a1b94145dd6105255d7d21a6b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 13 Jan 2016 18:02:03 -0800 Subject: add a call assert and debugging --- src/wasm-binary.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/wasm-binary.h') diff --git a/src/wasm-binary.h b/src/wasm-binary.h index ea2f24e9c..908121543 100644 --- a/src/wasm-binary.h +++ b/src/wasm-binary.h @@ -1113,9 +1113,12 @@ public: case BinaryConsts::CallFunction: { // might be an import or not. we have to check here. Name target = mappedFunctions[getLEB128()]; + assert(target.is()); + if (debug) std::cerr << "call(import?) target: " << target << std::endl; if (wasm.importsMap.find(target) == wasm.importsMap.end()) { return visitCall((curr = allocator.alloc())->cast(), target); } else { + assert(wasm.functionsMap.find(target) != wasm.functionsMap.end()); return visitCallImport((curr = allocator.alloc())->cast(), target); } } -- cgit v1.2.3