This is the mail archive of the binutils@sourceware.org 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]

[Committed] S/390: Add check for length field operand


Hi,

we currently accept operands like 123(%r6) for addresses with length
field. And surprisingly use 6 as length field value then.  I've
committed the attached patch which makes gas to issue a warning in
that case.

Bye,

-Andreas-

2015-03-10  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gas/config/tc-s390.c (md_gather_operands): Check for valid
	length field operands.

diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 9102c60..5051baf 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -1216,6 +1216,9 @@ md_gather_operands (char *str,
 	    }
 	  else
 	    {
+	      if ((operand->flags & S390_OPERAND_LENGTH)
+		  && ex.X_op != O_constant)
+		as_fatal (_("invalid length field specified"));
 	      if ((operand->flags & S390_OPERAND_INDEX)
 		  && ex.X_add_number == 0
 		  && warn_areg_zero)


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