2006-12-27 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 28 Dec 2006 07:09:16 +0000 (07:09 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 28 Dec 2006 07:09:16 +0000 (07:09 +0000)
* config/tc-i386.c (disp_expressions): Use MAX_MEMORY_OPERANDS
for array size instead of 2.
(im_expressions): Use MAX_IMMEDIATE_OPERANDS for for array size
instead of 2.
(i386_immediate): Update immediate operand overflow error
message.
(i386_displacement): Check displacement operand overflow.

gas/ChangeLog
gas/config/tc-i386.c

index 13eb348..c545ce1 100644 (file)
@@ -1,5 +1,15 @@
 2006-12-27  H.J. Lu  <hongjiu.lu@intel.com>
 
+       * config/tc-i386.c (disp_expressions): Use MAX_MEMORY_OPERANDS
+       for array size instead of 2.
+       (im_expressions): Use MAX_IMMEDIATE_OPERANDS for for array size
+       instead of 2.
+       (i386_immediate): Update immediate operand overflow error
+       message.
+       (i386_displacement): Check displacement operand overflow.
+
+2006-12-27  H.J. Lu  <hongjiu.lu@intel.com>
+
        * config/tc-i386.c: Document tc-i386.c, not i386.c.
 
 2006-12-27  Kazu Hirata  <kazu@codesourcery.com>
index fa69534..856e953 100644 (file)
@@ -272,8 +272,9 @@ static i386_insn i;
 /* Possible templates for current insn.  */
 static const templates *current_templates;
 
-/* Per instruction expressionS buffers: 2 displacements & 2 immediate max.  */
-static expressionS disp_expressions[2], im_expressions[2];
+/* Per instruction expressionS buffers: max displacements & immediates.  */
+static expressionS disp_expressions[MAX_MEMORY_OPERANDS];
+static expressionS im_expressions[MAX_IMMEDIATE_OPERANDS];
 
 /* Current operand we are working on.  */
 static int this_operand;
@@ -4504,7 +4505,8 @@ i386_immediate (char *imm_start)
 
   if (i.imm_operands == MAX_IMMEDIATE_OPERANDS)
     {
-      as_bad (_("only 1 or 2 immediate operands are allowed"));
+      as_bad (_("at most %d immediate operands are allowed"),
+             MAX_IMMEDIATE_OPERANDS);
       return 0;
     }
 
@@ -4645,6 +4647,13 @@ i386_displacement (disp_start, disp_end)
   int bigdisp, override;
   unsigned int types = Disp;
 
+  if (i.disp_operands == MAX_MEMORY_OPERANDS)
+    {
+      as_bad (_("at most %d displacement operands are allowed"),
+             MAX_MEMORY_OPERANDS);
+      return 0;
+    }
+
   if ((i.types[this_operand] & JumpAbsolute)
       || !(current_templates->start->opcode_modifier & (Jump | JumpDword)))
     {