Index: wasm/InputChunks.cpp =================================================================== --- wasm/InputChunks.cpp +++ wasm/InputChunks.cpp @@ -47,8 +47,6 @@ int64_t ExistingValue; switch (Reloc.Reloc.Type) { case R_WEBASSEMBLY_TYPE_INDEX_LEB: - case R_WEBASSEMBLY_FUNCTION_INDEX_LEB: - case R_WEBASSEMBLY_GLOBAL_INDEX_LEB: ExistingValue = decodeULEB128(Buf); // Additional check to verify that the existing value that the location // matches our expectations. @@ -57,6 +55,8 @@ assert(decodeULEB128(Buf) == Reloc.Reloc.Index); } LLVM_FALLTHROUGH; + case R_WEBASSEMBLY_FUNCTION_INDEX_LEB: + case R_WEBASSEMBLY_GLOBAL_INDEX_LEB: case R_WEBASSEMBLY_MEMORY_ADDR_LEB: encodeULEB128(Reloc.Value, Buf, 5); break;