GP-5189 Add range attributes to VarargsFilter

This commit is contained in:
caheckman 2024-12-02 20:33:01 +00:00
parent 57df41297f
commit e3aa064061
10 changed files with 128 additions and 28 deletions

View file

@ -412,13 +412,22 @@ bool VarargsFilter::filter(const PrototypePieces &proto,int4 pos) const
{
if (proto.firstVarArgSlot < 0) return false;
return (pos >= proto.firstVarArgSlot);
pos -= proto.firstVarArgSlot;
return (pos >= firstPos && pos <= lastPos);
}
void VarargsFilter::decode(Decoder &decoder)
{
uint4 elemId = decoder.openElement(ELEM_VARARGS);
for(;;) {
uint4 attribId = decoder.getNextAttributeId();
if (attribId == 0) break;
if (attribId == ATTRIB_FIRST)
firstPos = decoder.readSignedInteger();
else if (attribId == ATTRIB_LAST)
lastPos = decoder.readSignedInteger();
}
decoder.closeElement(elemId);
}