summaryrefslogtreecommitdiffstats
path: root/Tools/gdb/libpython.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-04-14 01:38:55 (GMT)
committerGitHub <noreply@github.com>2022-04-14 01:38:55 (GMT)
commitedf1a77f239069235f59103cfd8ce7f939c7fd10 (patch)
treeaf006d0db7fed16d8592df34ced5dc12ac282fdd /Tools/gdb/libpython.py
parenta8d245a675c11972390d1cfaea4a97151162e6e7 (diff)
downloadcpython-edf1a77f239069235f59103cfd8ce7f939c7fd10.zip
cpython-edf1a77f239069235f59103cfd8ce7f939c7fd10.tar.gz
cpython-edf1a77f239069235f59103cfd8ce7f939c7fd10.tar.bz2
gh-91421: Use constant value check during runtime (GH-91422) (GH-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 GH-91421. (cherry picked from commit 0859368335d470b9ff33fc53ed9a85ec2654b278) Co-authored-by: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
Diffstat (limited to 'Tools/gdb/libpython.py')
0 files changed, 0 insertions, 0 deletions