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>
This commit is contained in:
Michael Bradshaw 2018-11-21 11:03:13 -08:00 committed by Cyrill Gorcunov
parent 7b6371b9d3
commit fd14310469

View File

@ -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)