Index: lib/Object/WasmObjectFile.cpp =================================================================== --- lib/Object/WasmObjectFile.cpp +++ lib/Object/WasmObjectFile.cpp @@ -791,6 +791,7 @@ uint32_t GlobalIndex = Exports[Sym.ElementIndex].Index - NumImportedGlobals; assert(GlobalIndex < Globals.size()); const wasm::WasmGlobal& Global = Globals[GlobalIndex]; + assert(Global.InitExpr.Opcode == wasm::WASM_OPCODE_I32_CONST); return Global.InitExpr.Value.Int32; } case WasmSymbol::SymbolType::DEBUG_FUNCTION_NAME: Index: test/tools/llvm-nm/wasm/exports.yaml =================================================================== --- test/tools/llvm-nm/wasm/exports.yaml +++ test/tools/llvm-nm/wasm/exports.yaml @@ -19,17 +19,17 @@ - Type: I32 Mutable: false InitExpr: - Opcode: I64_CONST + Opcode: I32_CONST Value: 32 - Type: I32 Mutable: false InitExpr: - Opcode: I64_CONST + Opcode: I32_CONST Value: 64 - Type: I32 Mutable: false InitExpr: - Opcode: I64_CONST + Opcode: I32_CONST Value: 1024 - Type: IMPORT Imports: Index: test/tools/llvm-nm/wasm/weak-symbols.yaml =================================================================== --- test/tools/llvm-nm/wasm/weak-symbols.yaml +++ test/tools/llvm-nm/wasm/weak-symbols.yaml @@ -30,17 +30,17 @@ - Type: I32 Mutable: false InitExpr: - Opcode: I64_CONST + Opcode: I32_CONST Value: 32 - Type: I32 Mutable: false InitExpr: - Opcode: I64_CONST + Opcode: I32_CONST Value: 64 - Type: I32 Mutable: false InitExpr: - Opcode: I64_CONST + Opcode: I32_CONST Value: 1024 - Type: EXPORT Exports: