https://github.com/rengolin commented: The ternary is my fault and the correct fix, thanks! I don't know about the upper bound, though. Clearly the current code is bogus, but I'm not sure that's the fix. @MacDue https://github.com/llvm/llvm-project/pull/117227