This is related to libvroom.
If I have a location created using an index
auto lhs = vroom::Location(1);
and a location created using coordinates
auto rhs = vroom::Location(vroom::Coordinates{10, 11});
I would expect the below to pass
but this is not always the case. The comparison code checks presence of index only on left hand side object and assumes the right hand side object to have index as well. This reads to reading from an uninitialised member variable, which is undefined behaviour.
If I flip the arguments
the bug is bypassed and result is correct.
This is related to
libvroom.If I have a location created using an index
and a location created using coordinates
I would expect the below to pass
assert(!(lhs == rhs));but this is not always the case. The comparison code checks presence of index only on left hand side object and assumes the right hand side object to have index as well. This reads to reading from an uninitialised member variable, which is undefined behaviour.
If I flip the arguments
assert(!(rhs == lhs));the bug is bypassed and result is correct.