Remove typecast (size is determined by output)

This commit is contained in:
Alex Beregszaszi 2022-12-03 00:38:30 +01:00 committed by Daniel Kirchner
parent 7f33f15da3
commit fdec47d880

View File

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