tustvold commented on issue #2564:
URL: https://github.com/apache/arrow-rs/issues/2564#issuecomment-1225351143

   There's a subtlety here, you get an **unspecified** value not an undefined 
value. It is not UB to read a null value from a ListArray, StringArray, etc... 
It isn't defined what you will get, but you won't get uninitialised memory or 
something that would trigger undefined behaviour.
   
   TypedDictionaryArray is a special case because it is actually doing two 
array lookups. First it does a lookup into the indices array, if this index is 
null it gets back something unspecified. This is fine, however, this arbitrary 
value may not be in the bounds of the values, in which case we would access 
memory out of bounds.
   
   We could also validate the bounds for the value access, however, the NULL 
assertion I thought more clearly indicated the why.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to