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]

Yet another d10v gas fix


This patch:

2001-11-29  Alexandre Oliva  <aoliva@redhat.com>

	* config/tc-d10v.c (get_operands): Emit OPERAND_PLUS for
	prefix `+'.

introduced an operand without setting its X_op.  This would cause
problems at random, depending on previous contents of the memory
location.  I was lucky (or unlucky) that the testsuite didn't trigger
the problem :-(

This patch fixes it.  I'm checking it in, as obviously correct.

Index: gas/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/tc-d10v.c (get_operands): Mark OPERAND_PLUS after
	OPERAND_ATSIGN as O_absent.

Index: gas/config/tc-d10v.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-d10v.c,v
retrieving revision 1.23
diff -u -p -r1.23 tc-d10v.c
--- gas/config/tc-d10v.c 2001/12/04 17:30:43 1.23
+++ gas/config/tc-d10v.c 2001/12/12 07:22:02
@@ -459,8 +459,10 @@ get_operands (exp)
 	      exp[numops].X_add_number = OPERAND_ATSIGN;
 	      if (*p == '+')
 		{
-		  exp[++numops].X_add_number = OPERAND_PLUS;
-		  ++p;
+		  numops++;
+		  exp[numops].X_op = O_absent;
+		  exp[numops].X_add_number = OPERAND_PLUS;
+		  p++;
 		}
 	      post = postfix (p);
 	    }

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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