summaryrefslogtreecommitdiffstats
path: root/Python/dynload_shlib.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <stoeckmann@users.noreply.github.com>2022-04-13 03:01:02 (GMT)
committerGitHub <noreply@github.com>2022-04-13 03:01:02 (GMT)
commit0859368335d470b9ff33fc53ed9a85ec2654b278 (patch)
tree51a39bc30ccbf02ba40f80ff6e0bced6ac47702c /Python/dynload_shlib.c
parentac6c3de03c5bb06a9a463701fb297148f5a5746f (diff)
downloadcpython-0859368335d470b9ff33fc53ed9a85ec2654b278.zip
cpython-0859368335d470b9ff33fc53ed9a85ec2654b278.tar.gz
cpython-0859368335d470b9ff33fc53ed9a85ec2654b278.tar.bz2
gh-91421: Use constant value check during runtime (GH-91422)
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.
Diffstat (limited to 'Python/dynload_shlib.c')
0 files changed, 0 insertions, 0 deletions