diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-13 18:02:03 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-13 18:02:03 -0800 |
commit | 3334c090c73f861a1b94145dd6105255d7d21a6b (patch) | |
tree | 9b73f81f8e34b5957afa51e39de1c9e0355b6877 /src | |
parent | 4f559956ed0082347002ac257f7eda93c78dbaad (diff) | |
download | binaryen-3334c090c73f861a1b94145dd6105255d7d21a6b.tar.gz binaryen-3334c090c73f861a1b94145dd6105255d7d21a6b.tar.bz2 binaryen-3334c090c73f861a1b94145dd6105255d7d21a6b.zip |
add a call assert and debugging
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-binary.h | 3 |
1 files changed, 3 insertions, 0 deletions
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<Call>())->cast<Call>(), target); } else { + assert(wasm.functionsMap.find(target) != wasm.functionsMap.end()); return visitCallImport((curr = allocator.alloc<CallImport>())->cast<CallImport>(), target); } } |