fixed arrays using decl being init when assigning a number
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40207
This commit is contained in:
parent
455c03321c
commit
f807575429
@ -2502,6 +2502,10 @@ static void initials(int ident,int tag,cell *size,int dim[],int numdim,
|
|||||||
int curlit=litidx;
|
int curlit=litidx;
|
||||||
int err=0;
|
int err=0;
|
||||||
|
|
||||||
|
if (!autozero) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!matchtoken('=')) {
|
if (!matchtoken('=')) {
|
||||||
assert(ident!=iARRAY || numdim>0);
|
assert(ident!=iARRAY || numdim>0);
|
||||||
if (ident==iARRAY && dim[numdim-1]==0) {
|
if (ident==iARRAY && dim[numdim-1]==0) {
|
||||||
@ -2662,12 +2666,12 @@ static cell initvector(int ident,int tag,cell size,int fillzero,
|
|||||||
constvalue *enumroot,int *errorfound)
|
constvalue *enumroot,int *errorfound)
|
||||||
{
|
{
|
||||||
cell prev1=0,prev2=0;
|
cell prev1=0,prev2=0;
|
||||||
int ellips=FALSE,hadtoken=0;
|
int ellips=FALSE;
|
||||||
int curlit=litidx;
|
int curlit=litidx;
|
||||||
int rtag,ctag;
|
int rtag,ctag;
|
||||||
|
|
||||||
assert(ident==iARRAY || ident==iREFARRAY);
|
assert(ident==iARRAY || ident==iREFARRAY);
|
||||||
if ((hadtoken=matchtoken('{')) && autozero) {
|
if (matchtoken('{')) {
|
||||||
constvalue *enumfield=(enumroot!=NULL) ? enumroot->next : NULL;
|
constvalue *enumfield=(enumroot!=NULL) ? enumroot->next : NULL;
|
||||||
do {
|
do {
|
||||||
int fieldlit=litidx;
|
int fieldlit=litidx;
|
||||||
@ -2729,11 +2733,6 @@ static cell initvector(int ident,int tag,cell size,int fillzero,
|
|||||||
} while (matchtoken(',')); /* do */
|
} while (matchtoken(',')); /* do */
|
||||||
needtoken('}');
|
needtoken('}');
|
||||||
} else {
|
} else {
|
||||||
if (hadtoken && !autozero) {
|
|
||||||
error(10);
|
|
||||||
lexclr(TRUE); /* drop the rest of the line */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
init(ident,&ctag,errorfound);
|
init(ident,&ctag,errorfound);
|
||||||
if (!matchtag(tag,ctag,TRUE))
|
if (!matchtag(tag,ctag,TRUE))
|
||||||
error(213); /* tagname mismatch */
|
error(213); /* tagname mismatch */
|
||||||
|
Loading…
Reference in New Issue
Block a user