Index: lib/Object/WasmObjectFile.cpp =================================================================== --- lib/Object/WasmObjectFile.cpp +++ lib/Object/WasmObjectFile.cpp @@ -791,7 +791,14 @@ uint32_t GlobalIndex = Exports[Sym.ElementIndex].Index - NumImportedGlobals; assert(GlobalIndex < Globals.size()); const wasm::WasmGlobal& Global = Globals[GlobalIndex]; - return Global.InitExpr.Value.Int32; + switch (Global.InitExpr.Opcode) { + case wasm::WASM_OPCODE_I32_CONST: + return Global.InitExpr.Value.Int32; + case wasm::WASM_OPCODE_I64_CONST: + return Global.InitExpr.Value.Int64; + default: + return 0; + } } case WasmSymbol::SymbolType::DEBUG_FUNCTION_NAME: return Sym.ElementIndex;