[Commit] nickle ChangeLog,1.63,1.64 gram.y,1.133,1.134

Keith Packard commit at keithp.com
Thu Jun 3 00:46:26 PDT 2004


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv20001

Modified Files:
	ChangeLog gram.y 
Log Message:
2004-06-03  Keith Packard  <keithp at keithp.com>
version 2.39

	* gram.y:
	Fix fix for crash with empty array/hash initializers
	(really do need 'null' node in expr tree)


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- a/ChangeLog	3 Jun 2004 07:29:17 -0000	1.63
+++ b/ChangeLog	3 Jun 2004 07:46:23 -0000	1.64
@@ -2,6 +2,12 @@
 version 2.39
 
 	* gram.y:
+	Fix fix for crash with empty array/hash initializers
+	(really do need 'null' node in expr tree)
+
+2004-06-03  Keith Packard  <keithp at keithp.com>
+
+	* gram.y:
 	Fix crash with empty array/hash initializers
 
 2004-06-02  Keith Packard  <keithp at keithp.com>

Index: gram.y
===================================================================
RCS file: /local/src/CVS/nickle/gram.y,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- a/gram.y	3 Jun 2004 07:29:17 -0000	1.133
+++ b/gram.y	3 Jun 2004 07:46:23 -0000	1.134
@@ -1338,17 +1338,21 @@
 		    }
 		| OP OS dims CS CP namespace_start opt_arrayinit namespace_end
 		    { 
-			$7->base.type = NewTypeArray (typePoly, $3, False);
-			ParseCanonType ($7->base.type, False);
+			TypePtr	t = NewTypeArray (typePoly, $3, False);
+			ParseCanonType (t, False);
 			$$ = NewExprTree (NEW, $7, 0); 
-			$$->base.type = $7->base.type;
+			if ($7)
+			    $7->base.type = t;
+			$$->base.type = t;
 		    }
 		| OP OS type CS CP namespace_start opt_hashinit namespace_end
 		    {
-			$7->base.type = NewTypeHash (typePoly, $3);
-			ParseCanonType ($7->base.type, False);
+			TypePtr t = NewTypeHash (typePoly, $3);
+			ParseCanonType (t, False);
 			$$ = NewExprTree (NEW, $7, 0);
-			$$->base.type = $7->base.type;
+			if ($7)
+			    $7->base.type = t;
+			$$->base.type = t;
 		    }
 		| type DOT NAME						%prec UNIONCAST
 		    {
@@ -1409,9 +1413,9 @@
  */
 opt_arrayinit	: arrayinit
 		| OC CC
-		    { $$ = NewExprTree (ARRAY, 0, 0); }
+		    { $$ = 0; }
 		|
-		    { $$ = NewExprTree (ARRAY, 0, 0); }
+		    { $$ = 0; }
 		;
 arrayinit    	: OC arrayelts opt_comma opt_dotdotdot CC
 		    { 
@@ -1471,9 +1475,9 @@
  */
 opt_hashinit	: hashinit
 		| OC CC
-		    { $$ = NewExprTree (HASH, 0, 0); }
+		    { $$ = 0; }
 		|
-		    { $$ = NewExprTree (HASH, 0, 0); }
+		    { $$ = 0; }
 		;
 hashinit	: OC hashelts opt_comma CC
 		    {




More information about the Commit mailing list