Mercurial > projects > ldc
comparison dmd/init.c @ 336:aaade6ded589 trunk
[svn r357] Merged DMD 1.033
author | lindquist |
---|---|
date | Sat, 12 Jul 2008 19:38:31 +0200 |
parents | 2b72433d5c8c |
children | eeb8b95ea92e |
comparison
equal
deleted
inserted
replaced
335:17b844102023 | 336:aaade6ded589 |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | 2 // Compiler implementation of the D programming language |
3 // Copyright (c) 1999-2006 by Digital Mars | 3 // Copyright (c) 1999-2008 by Digital Mars |
4 // All Rights Reserved | 4 // All Rights Reserved |
5 // written by Walter Bright | 5 // written by Walter Bright |
6 // http://www.digitalmars.com | 6 // http://www.digitalmars.com |
7 // License for redistribution is by either the Artistic License | 7 // License for redistribution is by either the Artistic License |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | 8 // in artistic.txt, or the GNU General Public License in gnu.txt. |
164 | 164 |
165 if (id == NULL) | 165 if (id == NULL) |
166 { | 166 { |
167 if (fieldi >= ad->fields.dim) | 167 if (fieldi >= ad->fields.dim) |
168 { error(loc, "too many initializers for %s", ad->toChars()); | 168 { error(loc, "too many initializers for %s", ad->toChars()); |
169 field.remove(i); | |
170 i--; | |
169 continue; | 171 continue; |
170 } | 172 } |
171 else | 173 else |
172 { | 174 { |
173 s = (Dsymbol *)ad->fields.data[fieldi]; | 175 s = (Dsymbol *)ad->fields.data[fieldi]; |
374 val = (Initializer *)value.data[i]; | 376 val = (Initializer *)value.data[i]; |
375 val = val->semantic(sc, t->next); | 377 val = val->semantic(sc, t->next); |
376 value.data[i] = (void *)val; | 378 value.data[i] = (void *)val; |
377 length++; | 379 length++; |
378 if (length == 0) | 380 if (length == 0) |
379 error("array dimension overflow"); | 381 error(loc, "array dimension overflow"); |
380 if (length > dim) | 382 if (length > dim) |
381 dim = length; | 383 dim = length; |
382 } | 384 } |
383 unsigned long amax = 0x80000000; | 385 unsigned long amax = 0x80000000; |
384 if ((unsigned long) dim * t->next->size() >= amax) | 386 if ((unsigned long) dim * t->next->size() >= amax) |