On 2024-Oct-25, Tender Wang wrote:

> When I debug codes, I find that the way to access AttrMap almost uses
> "attrmp_ptr->attnums[offset]."
> The codes now usually don't check if the offset is out of bounds, which
> seems unsafe.
> Can we wrap an access function? For example:
> inline AttrNumber(attrmap_ptr, offset)
> {
>   Assert(offset >= 0 && offset < attrmap_ptr->maplen);
>  return attrmap_ptr->attnums[offset];
> }

I don't see any reason not to do this, though it's not directly related
to the bugs in this thread.  I encourage you to submit a patch, opening
a new thread.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/


Reply via email to