Fix enum field size (credit to @Arkshine)

This commit is contained in:
Marcin Misiurski 2015-03-25 14:19:10 +01:00
parent 0a4d9ca40b
commit 8e11f682d6
2 changed files with 2 additions and 2 deletions

View File

@ -2948,7 +2948,7 @@ SC_FUNC symbol *addvariable(const char *name,cell addr,int ident,int vclass,int
* the symbol without states if no symbol with states exists). * the symbol without states if no symbol with states exists).
*/ */
assert(vclass!=sGLOBAL || (sym=findglb(name,sGLOBAL))==NULL || (sym->usage & uDEFINE)==0 assert(vclass!=sGLOBAL || (sym=findglb(name,sGLOBAL))==NULL || (sym->usage & uDEFINE)==0
|| sym->ident==iFUNCTN && sym==curfunc || (sym->ident==iFUNCTN && sym==curfunc)
|| sym->states==NULL && sc_curstates>0); || sym->states==NULL && sc_curstates>0);
if (ident==iARRAY || ident==iREFARRAY) { if (ident==iARRAY || ident==iREFARRAY) {

View File

@ -2195,7 +2195,7 @@ static int nesting=0;
error(47); /* array sizes must match */ error(47); /* array sizes must match */
} /* if */ } /* if */
} /* if */ } /* if */
if (lval.ident!=iARRAYCELL) { if (lval.ident!=iARRAYCELL || lval.constval > 0) {
/* save array size, for default values with uSIZEOF flag */ /* save array size, for default values with uSIZEOF flag */
cell array_sz=lval.constval; cell array_sz=lval.constval;
assert(array_sz!=0);/* literal array must have a size */ assert(array_sz!=0);/* literal array must have a size */