diff options
author | Michael Bradshaw <mjbshaw@google.com> | 2018-11-21 11:03:13 -0800 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2018-11-23 23:51:16 +0300 |
commit | fd143104694ff3d92a8639c2eaf42dabad79b64e (patch) | |
tree | 9b0a93e216691ad409188ea0ddac5b5e9c61f32f | |
parent | 7b6371b9d35705ee3800082ca245f8dd289bb216 (diff) | |
download | nasm-fd143104694ff3d92a8639c2eaf42dabad79b64e.tar.gz |
Fix undefined behavior when shifting left by 32 bits
See https://bugzilla.nasm.us/show_bug.cgi?id=3392368
Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | asm/float.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/asm/float.c b/asm/float.c index 37f5585a..7d313a59 100644 --- a/asm/float.c +++ b/asm/float.c @@ -556,7 +556,7 @@ static bool ieee_flconvert_bin(const char *string, int bits, mp = &mult[MANT_LIMBS]; /* Guard slot */ ms += LIMB_BITS; } - *mp |= v << ms; + *mp |= v << (ms % (sizeof(fp_limb) * CHAR_BIT)); ms -= bits; if (!seendot) |