Hi,
I define a PDU like below:
type test_pdu = record {
lenAB : uint32;
pduAB : test_pdu_ab(lenAB);
} &length=(lenAB + 4), &exportsourcedata; # fail to compile without &length, &exportsourcedata will cause binpac crash
type test_pdu_ab(len: uint32) = record {
lenA : uint16;
dataA : bytestring &length = lenA;
dataB : bytestring &length = (len - 2 - lenA);
} &exportsourcedata; # &exportsourcedata here is OK
The error message is:
binpac: /home/grid/git/zeek/aux/binpac/src/pac_type.cc:857: std::__cxx11::string Type::EvalLengthExpr(Output*, Env*): Assertion `!incremental_input()’ failed.
Aborted (core dumped)
Best regards,
Song