[Commit] nickle ChangeLog,1.96,1.97 compile.c,1.159,1.160
Keith Packard
commit at keithp.com
Mon Nov 15 11:32:46 PST 2004
- Previous message: [Commit] nickle/examples Makefile.am, 1.2, 1.3 apsp.5c, 1.2,
1.3 comb.5c, 1.3, 1.4 cribbage.5c, 1.1, 1.2 erat.5c, 1.1,
1.2 google-puzzle.5c, 1.4, 1.5 initializer.5c, 1.1,
1.2 is-prime.5c, 1.2, 1.3 kaiser.5c, 1.4, 1.5 menace2.5c, 1.7, 1.8
- Next message: [Commit] nickle ChangeLog,1.98,1.99
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: keithp
Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv25619
Modified Files:
ChangeLog compile.c
Log Message:
2004-11-15 Keith Packard <keithp at keithp.com>
* compile.c: (CompileImplicitInit):
Implicitly initialize resizable arrays to zero-length array.
Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- ChangeLog 15 Nov 2004 19:31:40 -0000 1.96
+++ ChangeLog 15 Nov 2004 19:32:43 -0000 1.97
@@ -1,5 +1,10 @@
2004-11-15 Keith Packard <keithp at keithp.com>
+ * compile.c: (CompileImplicitInit):
+ Implicitly initialize resizable arrays to zero-length array.
+
+2004-11-15 Keith Packard <keithp at keithp.com>
+
* examples/Makefile.am:
* examples/apsp.5c:
* examples/comb.5c:
Index: compile.c
===================================================================
RCS file: /local/src/CVS/nickle/compile.c,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -d -r1.159 -r1.160
--- compile.c 1 Oct 2004 19:58:54 -0000 1.159
+++ compile.c 15 Nov 2004 19:32:43 -0000 1.160
@@ -1884,26 +1884,33 @@
switch (type->base.tag) {
case type_array:
- if (type->array.dimensions && type->array.dimensions->tree.left)
+ if (type->array.dimensions)
{
- sub = type->array.type;
- init = CompileImplicitInit (sub);
- if (init)
+ if (type->array.resizable)
{
- dim = CompileCountDeclDimensions (type->array.dimensions);
- while (--dim >= 0)
+ init = NewExprTree (ANONINIT, 0, 0);
+ }
+ else if (type->array.dimensions->tree.left)
+ {
+ sub = type->array.type;
+ init = CompileImplicitInit (sub);
+ if (init)
{
- init = NewExprTree (ARRAY,
- NewExprTree (COMMA,
- init,
- NewExprTree (COMMA,
- NewExprTree (DOTDOTDOT, 0, 0),
- 0)),
- 0);
+ dim = CompileCountDeclDimensions (type->array.dimensions);
+ while (--dim >= 0)
+ {
+ init = NewExprTree (ARRAY,
+ NewExprTree (COMMA,
+ init,
+ NewExprTree (COMMA,
+ NewExprTree (DOTDOTDOT, 0, 0),
+ 0)),
+ 0);
+ }
}
+ else
+ init = NewExprTree (ANONINIT, 0, 0);
}
- else
- init = NewExprTree (ANONINIT, 0, 0);
}
break;
case type_hash:
- Previous message: [Commit] nickle/examples Makefile.am, 1.2, 1.3 apsp.5c, 1.2,
1.3 comb.5c, 1.3, 1.4 cribbage.5c, 1.1, 1.2 erat.5c, 1.1,
1.2 google-puzzle.5c, 1.4, 1.5 initializer.5c, 1.1,
1.2 is-prime.5c, 1.2, 1.3 kaiser.5c, 1.4, 1.5 menace2.5c, 1.7, 1.8
- Next message: [Commit] nickle ChangeLog,1.98,1.99
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commit
mailing list