diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index 93d321e..455d1b7 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -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). */ 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); if (ident==iARRAY || ident==iREFARRAY) { diff --git a/source/compiler/sc3.c b/source/compiler/sc3.c index fa2f771..375c105 100644 --- a/source/compiler/sc3.c +++ b/source/compiler/sc3.c @@ -2195,7 +2195,7 @@ static int nesting=0; error(47); /* array sizes must match */ } /* if */ } /* if */ - if (lval.ident!=iARRAYCELL) { + if (lval.ident!=iARRAYCELL || lval.constval > 0) { /* save array size, for default values with uSIZEOF flag */ cell array_sz=lval.constval; assert(array_sz!=0);/* literal array must have a size */