Re:1.5 is the midpoint between 0 and infinity in Ruby
by bertr4nd on Saturday November 28, 2020 @01:29AM
(#25235736)
My reading of section 8.2.1 suggests that it is not UB to copy bytes from an object of one type to an object of another type, and then to read the value of the second object, since it is explicitly allowed to access each object as bytes.
[ Parent
| on HN ]
Re:1.5 is the midpoint between 0 and infinity in Ruby
by kazinator on Saturday November 28, 2020 @12:46PM
(#25239039)
It being well-defined to access an object as an array of bytes doesn't add up to it being well-defined to access a whole object as an lvalue of any type. Type aliasing rules do not work this in this constructive way.