Hi, thanks for DDO — it works very well overall.
I noticed an issue when decoding MsgPack uint64 values at the upper end of the range. For example, decoding UInt64.MaxValue raises an exception:
is too large of an unsigned 64-bit integer to fit in a signed 64-bit integer type.
I traced this to DataObjects2MsgPack.pas, where large uint64 values are explicitly rejected:
$cf: begin // uInt 64
fStream.Read(lUInt64, 8);
lUInt64 := SwapBytes(lUInt64);
if lUInt64 <= $7FFFFFFFFFFFFFFF then
aDataObj.AsInt64 := lUInt64
else
raise Exception.Create(IntToHex(lUInt64)+' is too large of an unsigned 64-bit integer to fit in a signed 64-bit integer type.');
end;
From the codebase, it seems TDataObj already has a SetAsUInt64 method. Because of that, I wanted to ask:
- Is there a design reason why MsgPack decoding does not support the full
UInt64 range?
- Would it be possible to decode
$cf values larger than Int64.MaxValue via AsUInt64 instead of raising an exception?
It would be great if DDO could support the full MsgPack uint64 range.
If helpful, I can also put together a minimal repro case.
Hi, thanks for DDO — it works very well overall.
I noticed an issue when decoding MsgPack
uint64values at the upper end of the range. For example, decodingUInt64.MaxValueraises an exception:I traced this to
DataObjects2MsgPack.pas, where largeuint64values are explicitly rejected:From the codebase, it seems
TDataObjalready has aSetAsUInt64method. Because of that, I wanted to ask:UInt64range?$cfvalues larger thanInt64.MaxValueviaAsUInt64instead of raising an exception?It would be great if DDO could support the full MsgPack
uint64range.If helpful, I can also put together a minimal repro case.