aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r--llvm/lib/Object/WasmObjectFile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
index ad8c2b7..e1bab72 100644
--- a/llvm/lib/Object/WasmObjectFile.cpp
+++ b/llvm/lib/Object/WasmObjectFile.cpp
@@ -788,7 +788,7 @@ uint64_t WasmObjectFile::getSymbolValueImpl(DataRefImpl Symb) const {
case WasmSymbol::SymbolType::FUNCTION_EXPORT:
return Exports[Sym.ElementIndex].Index;
case WasmSymbol::SymbolType::GLOBAL_EXPORT: {
- uint32_t GlobalIndex = Exports[Sym.ElementIndex].Index;
+ uint32_t GlobalIndex = Exports[Sym.ElementIndex].Index - NumImportedGlobals;
assert(GlobalIndex < Globals.size());
const wasm::WasmGlobal& Global = Globals[GlobalIndex];
return Global.InitExpr.Value.Int32;