diff --git a/lld/wasm/SyntheticSections.cpp b/lld/wasm/SyntheticSections.cpp index f02f55519a251..72d08b849d8e8 100644 --- a/lld/wasm/SyntheticSections.cpp +++ b/lld/wasm/SyntheticSections.cpp @@ -587,8 +587,7 @@ void ElemSection::writeBody() { initExpr.Inst.Value.Global = WasmSym::tableBase->getGlobalIndex(); } else { bool is64 = config->is64.value_or(false); - initExpr.Inst.Opcode = is64 ? WASM_OPCODE_I64_CONST : WASM_OPCODE_I32_CONST; - initExpr.Inst.Value.Int32 = config->tableBase; + initExpr = intConst(config->tableBase, is64); } writeInitExpr(os, initExpr);