gh-91421: Use constant value check during runtime (GH-91422) (GH-91492)
The left-hand side expression of the if-check can be converted to a constant by the compiler, but the addition on the right-hand side is performed during runtime. Move the addition from the right-hand side to the left-hand side by turning it into a subtraction there. Since the values are known to be large enough to not turn negative, this is a safe operation. Prevents a very unlikely integer overflow on 32 bit systems. Fixes GH-91421. (cherry picked from commit 0859368335d470b9ff33fc53ed9a85ec2654b278) Co-authored-by: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
M
Miss Islington (bot) committed
72114c06fd8f105437d671277b0593a378ecc3f4
Parent: 89697f7
Committed by GitHub <noreply@github.com>
on 4/14/2022, 1:38:37 AM