diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-04-04 13:34:53 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-04-04 13:34:53 -0700 |
commit | 32cd4c2a62f34815dbc9c13e1e6640bb096d05b5 (patch) | |
tree | b102f98dbf7c28e18f114f944c006ab7499a2904 /parser.c | |
parent | 5a7976c925e494bfd0db806c5f5724157236b4e3 (diff) | |
download | nasm-32cd4c2a62f34815dbc9c13e1e6640bb096d05b5.tar.gz nasm-32cd4c2a62f34815dbc9c13e1e6640bb096d05b5.tar.bz2 nasm-32cd4c2a62f34815dbc9c13e1e6640bb096d05b5.zip |
Correctly identify SBYTE in the optimizer
Correctly identify SBYTE in the optimizer, *HOWEVER*, this change will
cause nuisance warnings to be issued; that will have to be fixed.
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -797,9 +797,16 @@ restart_parse: result->oprs[operand].type |= UNITY; if (optimizing >= 0 && !(result->oprs[operand].type & STRICT)) { - if (reloc_value(value) >= -128 && - reloc_value(value) <= 127) - result->oprs[operand].type |= SBYTE; + int64_t v64 = reloc_value(value); + int32_t v32 = (int32_t)v64; + int16_t v16 = (int16_t)v32; + + if (v64 >= -128 && v64 <= 127) + result->oprs[operand].type |= SBYTE64; + if (v32 >= -128 && v32 <= 127) + result->oprs[operand].type |= SBYTE32; + if (v16 >= -128 && v16 <= 127) + result->oprs[operand].type |= SBYTE16; } } } else { /* it's a register */ |