diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:00:50 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-24 01:00:50 +0000 |
commit | 0d9ba4fe26725cacc7253fc3c72c4574f26bc099 (patch) | |
tree | 90c426d54188ca226b29aaf8a308bba364a73d1a /wasm/InputFiles.cpp | |
parent | eb1ff93d02b5f17b6b409e83c6d9be585f4a04b3 (diff) |
Notes
Diffstat (limited to 'wasm/InputFiles.cpp')
-rw-r--r-- | wasm/InputFiles.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/wasm/InputFiles.cpp b/wasm/InputFiles.cpp index e7463da39db9..1a1a6812c48e 100644 --- a/wasm/InputFiles.cpp +++ b/wasm/InputFiles.cpp @@ -198,13 +198,22 @@ void ObjFile::initializeSymbols() { DEBUG(dbgs() << "Function: " << WasmSym.ElementIndex << " -> " << toString(*S) << "\n"); FunctionSymbols[WasmSym.ElementIndex] = S; + if (WasmSym.HasAltIndex) + FunctionSymbols[WasmSym.AltIndex] = S; } else { DEBUG(dbgs() << "Global: " << WasmSym.ElementIndex << " -> " << toString(*S) << "\n"); GlobalSymbols[WasmSym.ElementIndex] = S; + if (WasmSym.HasAltIndex) + GlobalSymbols[WasmSym.AltIndex] = S; } } + DEBUG(for (size_t I = 0; I < FunctionSymbols.size(); ++I) + assert(FunctionSymbols[I] != nullptr); + for (size_t I = 0; I < GlobalSymbols.size(); ++I) + assert(GlobalSymbols[I] != nullptr);); + // Populate `TableSymbols` with all symbols that are called indirectly uint32_t SegmentCount = WasmObj->elements().size(); if (SegmentCount) { |