This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[commit] Fix some go-exp.y crashes


Hi.

This patch is to add some missing setting of yylval fields.
Committed.

2012-05-08  Doug Evans  <dje@google.com>

	* go-exp.y (classify_name): Add missing assignment of fields of
	yylval.ssym.

Index: go-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/go-exp.y,v
retrieving revision 1.1
diff -u -p -r1.1 go-exp.y
--- go-exp.y	25 Apr 2012 14:07:20 -0000	1.1
+++ go-exp.y	9 May 2012 05:07:15 -0000
@@ -1482,7 +1482,7 @@ classify_name (struct block *block)
 			     &is_a_field_of_this);
 	if (sym)
 	  {
-	    yylval.sval = sval;
+	    yylval.ssym.stoken = sval;
 	    yylval.ssym.sym = sym;
 	    yylval.ssym.is_a_field_of_this = is_a_field_of_this;
 	    return NAME;
@@ -1499,9 +1499,15 @@ classify_name (struct block *block)
       YYSTYPE newlval;	/* Its value is ignored.  */
       int hextype = parse_number (copy, yylval.sval.length, 0, &newlval);
       if (hextype == INT)
-	return NAME_OR_INT;
+	{
+	  yylval.ssym.sym = NULL;
+	  yylval.ssym.is_a_field_of_this = 0;
+	  return NAME_OR_INT;
+	}
     }
 
+  yylval.ssym.sym = NULL;
+  yylval.ssym.is_a_field_of_this = 0;
   return NAME;
 }
 


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