BR 2887108: Use overflow_ helper to catch inappropriate imm optimization
commit41208028ff52d190044ee7532bf14c5aca0f899a
authorCyrill Gorcunov <gorcunov@gmail.com>
Sat, 31 Oct 2009 07:34:43 +0000 (31 10:34 +0300)
committerCyrill Gorcunov <gorcunov@gmail.com>
Sat, 31 Oct 2009 07:35:11 +0000 (31 10:35 +0300)
tree2418e92ba336b3ed09a11eea52adffb646321b47
parent4ea846623aa7633ac010504b013cc1c73a5fc09a
BR 2887108: Use overflow_ helper to catch inappropriate imm optimization

We should use overflow_ helpers before check if an immediate
operand fit a type range, otherwise we may loose high bits.

For example when we assemble the following instruction

imul eax,eax,0x10000

with -Ox passed we optimze it up to imm8 though it must be imm32.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
parser.c