diff options
| author | Jeff Epler <jepler@gmail.com> | 2019-10-08 10:48:25 +0900 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2019-10-08 10:48:25 +0900 |
| commit | 0d96f1906b66139beebc13c55078aaf610c76968 (patch) | |
| tree | abd0b6ea03c1dfd7daf6a1b5e97a3fe047963ade /py/persistentcode.h | |
| parent | 4eb11fbde65872bf3385bfd1b487adf72eec4016 (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/persistentcode.h')
0 files changed, 0 insertions, 0 deletions
