Fix enum field size (credit to @Arkshine)
This commit is contained in:
parent
0a4d9ca40b
commit
8e11f682d6
@ -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) {
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user