diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2015-10-11 17:57:04 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2015-10-11 18:06:30 +0300 |
commit | 6377180e0873731f60a18fe5a61065f9c7795603 (patch) | |
tree | 304a37453a8f8b65e6c3108b4f3609048dfc68e9 | |
parent | b0b969eec48d9800f34dc60bff21f6eee981d8fe (diff) | |
download | nasm-6377180e0873731f60a18fe5a61065f9c7795603.tar.gz |
nasmlib: Plcate undefined behaviour in signed_bits
http://bugzilla.nasm.us/show_bug.cgi?id=3392320
Reported-by: Dingbao Xie <xiedingbao@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | nasmlib.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -456,7 +456,7 @@ static inline int64_t signed_bits(int64_t value, int bits) if (bits < 64) { value &= ((int64_t)1 << bits) - 1; if (value & (int64_t)1 << (bits - 1)) - value |= (int64_t)-1 << bits; + value |= (int64_t)((uint64_t)-1 << bits); } return value; } |