Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-91421: Use constant value check during runtime (pythonGH-91422…
…) (pythonGH-91493) 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 pythonGH-91421. (cherry picked from commit 0859368) Co-authored-by: Tobias Stoeckmann <[email protected]>
- Loading branch information