nasm/asm
H. Peter Anvin 79a070eea9 BR 3392368: correct handling of exact limb switch
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>
2018-11-26 14:17:40 -08:00
..
assemble.c optimization: Introduce new flag to turn-off selectively 2018-08-16 00:01:31 +03:00
assemble.h Add a generic pragma-handling infrastructure 2017-03-07 21:32:37 -08:00
directiv.c absolute: in absolute space, need to use absolute.segment 2018-06-25 14:09:52 -07:00
directiv.dat Make any execution limit configurable, add eval limit 2018-06-12 13:54:42 -07:00
error.c asm: add a default-off warning for phase error in pass 1 2018-06-27 21:03:38 -07:00
eval.c eval: Eliminate division by zero 2018-10-14 01:49:43 +03:00
eval.h
exprdump.c exprlib: move dumping code to a separate C file 2017-02-28 18:13:43 -08:00
exprlib.c exprlib: move dumping code to a separate C file 2017-02-28 18:13:43 -08:00
float.c BR 3392368: correct handling of exact limb switch 2018-11-26 14:17:40 -08:00
float.h
labels.c labels: Make sure nil label is never passed 2018-10-13 17:18:05 +03:00
listing.c gcc: fix mistakes discovered by recent gcc 2018-06-02 23:48:16 -07:00
listing.h New backend interface - assembler internals #1 2016-09-20 16:05:09 -07:00
nasm.c BR 3392529: remove excess printf() argument 2018-11-26 14:15:46 -08:00
parser.c parser: Fix sigsegv on certain equ instruction parsing 2018-10-13 18:10:30 +03:00
parser.h Cleanup of label renaming infrastructure, add subsection support 2018-06-01 18:06:25 -07:00
phash.pl
pptok.dat Merge remote-tracking branch 'origin/nasm-2.12.xx' 2016-10-04 14:09:07 -07:00
pptok.pl perl: change to the new, safer 3-operand form of open() 2017-04-02 19:36:41 -07:00
pragma.c pragma: define a hander for generic output (and debug) pragmas 2018-06-18 11:34:33 -07:00
preproc-nop.c Add --pragma and --before option; make --include = -P 2018-06-11 13:32:42 -07:00
preproc.c preproc: Don't access out of bound data on malformed input 2018-10-29 22:54:34 +03:00
preproc.h
quote.c
quote.h
rdstrnum.c rdstrnum: Make sure we dont shift out of bound 2018-10-29 22:25:16 +03:00
segalloc.c segalloc: DO NOT reset segment numbers 2018-06-14 16:42:03 -07:00
stdscan.c asm/*: Move directive processing to its own file, refactor error handling 2017-03-07 19:31:04 -08:00
stdscan.h
strfunc.c
tokens.dat
tokhash.pl perl: change to the new, safer 3-operand form of open() 2017-04-02 19:36:41 -07:00