* Gets function size field from right location
* Writes I32 values during compression
Patch by Yury Delendik
Differential Revision: https://reviews.llvm.org/D47204
llvm-svn: 333002
return encodeSLEB128(static_cast<int32_t>(Value), Buf);
case R_WEBASSEMBLY_TABLE_INDEX_I32:
case R_WEBASSEMBLY_MEMORY_ADDR_I32:
+ write32le(Buf, Value);
return 4;
default:
llvm_unreachable("unknown relocation type");
const uint8_t *FuncStart = SecStart + getInputSectionOffset();
const uint8_t *End = FuncStart + Function->Size;
uint32_t Count;
- decodeULEB128(Buf, &Count);
+ decodeULEB128(FuncStart, &Count);
FuncStart += Count;
DEBUG(dbgs() << "write func: " << getName() << "\n");