summaryrefslogtreecommitdiff
path: root/py/stackctrl.h
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2019-10-08 10:48:25 +0900
committerJeff Epler <jepler@gmail.com>2019-10-08 10:48:25 +0900
commit0d96f1906b66139beebc13c55078aaf610c76968 (patch)
treeabd0b6ea03c1dfd7daf6a1b5e97a3fe047963ade /py/stackctrl.h
parent4eb11fbde65872bf3385bfd1b487adf72eec4016 (diff)
mp_binary_get_int: avoid undefined behavior
Left shift of negative numbers is undefined in the "C" standard. Multiplying by 256 has the intended effect (in the absence of integer overflow, anyway), can be implemented using the same shift instruction, but does not invoke undefined behavior. This problem was found using clang 7's scan-build static analyzer.
Diffstat (limited to 'py/stackctrl.h')
0 files changed, 0 insertions, 0 deletions