mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-07 13:18:43 +02:00
rend() creates a pointer with offset -1. This is UB, according to the C++ standard: https://eel.is/c++draft/expr.add#4: When an expression J that has integral type is added to [...] an expression P of pointer type, the result has the type of P. ... if P points to a (possibly-hypothetical) array element i of an array object x with n elements [...] the expressions P + J and J + P (where J has the value j) point to the (possibly-hypothetical) array element i+j of x if 0≤i+j≤n [...] Otherwise, the behavior is undefined. Also, it is unclear why the functions exist at all, when stdlib utils such as std::reverse_iterator{it} or std::views::reverse can be used out of the box. So remove them, along with the ubsan suppressions, that are no longer used.