diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 50b7c320..5944a520 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -1678,8 +1678,10 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst if (size > INT_MAX) error(105); /* overflow, exceeding capacity */ #endif +#if 0 /* We don't actually care */ if (ispublic) error(56,name); /* arrays cannot be public */ +#endif dim[numdim++]=(int)size; } /* while */ assert(sc_curstates==0); @@ -1857,7 +1859,7 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst assert(sym!=NULL); sc_curstates=0; if (ispublic) - sym->usage|=uPUBLIC; + sym->usage|=uPUBLIC|uREAD; if (fconst) sym->usage|=uCONST; if (fstock) diff --git a/sourcepawn/compiler/sc6.c b/sourcepawn/compiler/sc6.c index 97ead13e..1c397fd5 100644 --- a/sourcepawn/compiler/sc6.c +++ b/sourcepawn/compiler/sc6.c @@ -713,7 +713,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin) assert(sym->vclass==sGLOBAL); mainaddr=sym->addr; } /* if */ - } else if (sym->ident==iVARIABLE) { + } else if (sym->ident==iVARIABLE || sym->ident == iARRAY || sym->ident == iREFARRAY) { if ((sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0) match=++numpubvars; } /* if */ @@ -891,7 +891,8 @@ SC_FUNC int assemble(FILE *fout,FILE *fin) /* write the public variables table */ count=0; for (sym=glbtab.next; sym!=NULL; sym=sym->next) { - if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0) { + if ((sym->ident==iVARIABLE || sym->ident==iARRAY || sym->ident==iREFARRAY) + && (sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0) { assert((sym->usage & uDEFINE)!=0); assert(sym->vclass==sGLOBAL); func.address=sym->addr;