diff options
-rw-r--r-- | lld/wasm/Writer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index d6578957b54..1e51b70f770 100644 --- a/lld/wasm/Writer.cpp +++ b/lld/wasm/Writer.cpp @@ -571,9 +571,12 @@ void Writer::calculateImports() { } uint32_t Writer::lookupType(const WasmSignature &Sig) { - if (TypeIndices.count(Sig) == 0) + auto It = TypeIndices.find(Sig); + if (It == TypeIndices.end()) { error("type not found: " + toString(Sig)); - return TypeIndices.lookup(Sig); + return 0; + } + return It->second; } uint32_t Writer::registerType(const WasmSignature &Sig) { |