OSDN Git Service

* config/tc-s390.c (s390_insn): Correct range check for opcode in
authorsky <sky>
Fri, 27 Feb 2004 12:33:10 +0000 (12:33 +0000)
committersky <sky>
Fri, 27 Feb 2004 12:33:10 +0000 (12:33 +0000)
.insn pseudo operation.

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

index 1064635..b8b3d5e 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-27  Hannes Reinecke  <hare@suse.de>
+
+       * config/tc-s390.c (s390_insn): Correct range check for opcode in
+       .insn pseudo operation.
+
 2004-02-27  Anil Paranjpe  <anilp1@kpitcummins.com>
 
        * config/tc-sh.c (get_operand):  In case of #Imm, check has been
index ef51bca..c450eae 100644 (file)
@@ -1614,9 +1614,15 @@ s390_insn (ignore)
   expression (&exp);
   if (exp.X_op == O_constant)
     {
-      if (   (opformat->oplen == 6 && exp.X_op > 0 && exp.X_op < (1ULL << 48))
-         || (opformat->oplen == 4 && exp.X_op > 0 && exp.X_op < (1ULL << 32))
-         || (opformat->oplen == 2 && exp.X_op > 0 && exp.X_op < (1ULL << 16)))
+      if (   (   opformat->oplen == 6
+             && exp.X_add_number >= 0
+             && (addressT) exp.X_add_number < (1ULL << 48))
+         || (   opformat->oplen == 4
+             && exp.X_add_number >= 0
+             && (addressT) exp.X_add_number < (1ULL << 32))
+         || (   opformat->oplen == 2
+             && exp.X_add_number >= 0
+             && (addressT) exp.X_add_number < (1ULL << 16)))
        md_number_to_chars (insn, exp.X_add_number, opformat->oplen);
       else
        as_bad (_("Invalid .insn format\n"));