-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
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
UInt64range? - Would it be possible to decode
$cfvalues larger thanInt64.MaxValueviaAsUInt64instead 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels