aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i386.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@google.com>2000-10-15 06:17:36 +0000
committerDiego Novillo <dnovillo@google.com>2000-10-15 06:17:36 +0000
commit6588847e4f855188fcd187e6484791dffc350469 (patch)
tree74069e9c16c69453eab5644111a3f166a0a057d9 /gas/config/tc-i386.c
parenta4b120e1dbadd011de3b3e419df754d8636b29af (diff)
downloadgdb-6588847e4f855188fcd187e6484791dffc350469.zip
gdb-6588847e4f855188fcd187e6484791dffc350469.tar.gz
gdb-6588847e4f855188fcd187e6484791dffc350469.tar.bz2
gas:
2000-10-15 Diego Novillo <dnovillo@cygnus.com> * config/tc-i386.c (i386_operand_modifier): Only match modifiers SHORT and FLAT if they are followed by a space. (parse_register): When `allow_naked_reg' is set, do not confuse identifiers that start with a register name with a register. gas/testsuite: 2000-10-15 Diego Novillo <dnovillo@cygnus.com> * intel.s, intel.d: Add new tests for naked registers using intel syntax.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r--gas/config/tc-i386.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 31e6bfa..83c1e7b 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3026,7 +3026,9 @@ i386_operand_modifier (op_string, got_a_float)
return XWORD_PTR;
}
- else if (!strncasecmp (*op_string, "SHORT", 5))
+ /* Compare with space separator to avoid confusing identifier `short_var'
+ with attribute `short'. */
+ else if (!strncasecmp (*op_string, "SHORT ", 6))
{
*op_string += 5;
return SHORT;
@@ -3038,7 +3040,9 @@ i386_operand_modifier (op_string, got_a_float)
return OFFSET_FLAT;
}
- else if (!strncasecmp (*op_string, "FLAT", 4))
+ /* Compare with space separator to avoid confusing identifier `flat_var'
+ with attribute `flat'. */
+ else if (!strncasecmp (*op_string, "FLAT ", 5))
{
*op_string += 4;
return FLAT;
@@ -4235,6 +4239,12 @@ parse_register (reg_string, end_op)
s++;
}
+ /* For naked regs, make sure that we are not dealing with an identifier.
+ This prevents confusing an identifier like `eax_var' with register
+ `eax'. */
+ if (allow_naked_reg && identifier_chars[(unsigned char) *s])
+ return (const reg_entry *) NULL;
+
*end_op = s;
r = (const reg_entry *) hash_find (reg_hash, reg_name_given);