Remove typecast (size is determined by output)

This commit is contained in:
Alex Beregszaszi 2022-12-03 00:38:30 +01:00 committed by Rodrigo Q. Saramago
parent eed10c5d81
commit ab2f46639c
No known key found for this signature in database
GPG Key ID: 9B36B2525704A359

View File

@ -705,7 +705,7 @@ LinkerObject const& Assembly::assemble(bool eof) const
if (eof) if (eof)
{ {
assertThrow(codeLength > 0 && codeLength <= 0xffff, AssemblyException, "Invalid code section size."); assertThrow(codeLength > 0 && codeLength <= 0xffff, AssemblyException, "Invalid code section size.");
toBigEndian(uint16_t(codeLength), eofCodeLength); toBigEndian(codeLength, eofCodeLength);
} }
auto const dataStart = ret.bytecode.size(); auto const dataStart = ret.bytecode.size();
@ -778,7 +778,7 @@ LinkerObject const& Assembly::assemble(bool eof) const
if (eof) if (eof)
{ {
assertThrow(/*dataLength >= 0 && */ dataLength <= 0xffff, AssemblyException, "Invalid data section size."); assertThrow(/*dataLength >= 0 && */ dataLength <= 0xffff, AssemblyException, "Invalid data section size.");
toBigEndian(uint16_t(dataLength), eofDataLength); toBigEndian(dataLength, eofDataLength);
} }
return ret; return ret;