mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-15 09:09:58 +08:00
79a070eea9
When we have an exact limb switch, we may end up with a case where the value no longer has any remaining valid bits. In that case, we end up relying on the expression *mp |= v << ms shifting the bits on the subsequent limb all the way to zero, but that is not how real hardware works when the shift count equals the width of the type. This is undefined behavior and does, in fact, produce the wrong result. Instead, change the test for limb shift to (ms < 0), meaning that we defer the advance to the next limb until we actually need it. At that point, change the shift into the *old* limb to have a cast to (fp_2limb) which means the shift right of LIMB_BITS is valid and produces a zero value as expected. Reported-by: Brooks Moses <bmoses@google.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> |
||
---|---|---|
.. | ||
assemble.c | ||
assemble.h | ||
directiv.c | ||
directiv.dat | ||
error.c | ||
eval.c | ||
eval.h | ||
exprdump.c | ||
exprlib.c | ||
float.c | ||
float.h | ||
labels.c | ||
listing.c | ||
listing.h | ||
nasm.c | ||
parser.c | ||
parser.h | ||
phash.pl | ||
pptok.dat | ||
pptok.pl | ||
pragma.c | ||
preproc-nop.c | ||
preproc.c | ||
preproc.h | ||
quote.c | ||
quote.h | ||
rdstrnum.c | ||
segalloc.c | ||
stdscan.c | ||
stdscan.h | ||
strfunc.c | ||
tokens.dat | ||
tokhash.pl |