Index: llvm/trunk/lib/MC/WasmObjectWriter.cpp =================================================================== --- llvm/trunk/lib/MC/WasmObjectWriter.cpp +++ llvm/trunk/lib/MC/WasmObjectWriter.cpp @@ -1105,7 +1105,7 @@ encodeULEB128(wasm::WASM_SEC_CODE, getStream()); - encodeULEB128(CodeRelocations.size(), getStream()); + encodeULEB128(CodeRelocations.size() + TypeIndexFixups.size(), getStream()); WriteRelocations(CodeRelocations, getStream(), SymbolIndices); WriteTypeRelocations(TypeIndexFixups, TypeIndexFixupTypes, getStream());