This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] s390* .insn pseudo op fix.


Hi,
another fix for s390*. The range check for the opcode in the .insn pseudo
operation is wrong. It checks against exp.X_op instead of exp.X_add_number.

blue skies,
  Martin.

2004-02-27  Hannes Reinecke  <hare@suse.de>

	* config/tc-s390.c (s390_insn): Correct range check for opcode in
	.insn pseudo operation.

diff -urN src/gas/config/tc-s390.c src-s390/gas/config/tc-s390.c
--- src/gas/config/tc-s390.c	2004-02-27 11:13:31.000000000 +0100
+++ src-s390/gas/config/tc-s390.c	2004-02-27 11:12:00.000000000 +0100
@@ -1614,9 +1614,15 @@
   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"));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]