IonSymbolTable fails with very large keys
ellie-idb opened this issue · 0 comments
ellie-idb commented
In the MessagePack deserializer, this test fails:
/// Test map with varying key lengths
@safe pure
version(mir_ion_msgpack_test)
unittest
{
import mir.ion.ser.msgpack : serializeMsgpack;
import std.array : replicate;
ubyte[string] map;
map["c".replicate(ushort.max + 1)] = 0xFF;
assert(serializeMsgpack(map).deserializeMsgpack!(typeof(map)) == map);
}
I've narrowed this down to this specific line where we grow the key-space.
mir-ion/source/mir/ion/symbol_table.d
Line 362 in b3efeec
I believe that this
if
should actually be a while
, otherwise we give up on growing the key-space way too early.