fixed a bug where determinate 1D arrays would not have correct sizeof() -- REALLY hacky fix :(

fixed local arrays asserting on more than two dimensions with the last dimension being indeterminate

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40516
This commit is contained in:
David Anderson
2007-02-17 04:37:47 +00:00
parent 3f1051e83b
commit 314f3401c8
3 changed files with 20 additions and 3 deletions
+10
View File
@@ -170,6 +170,7 @@ static int *wqptr; /* pointer to next entry */
static HWND hwndFinish = 0;
#endif
SC_VDECL int glbstringread = 0;
char g_tmpfile[_MAX_PATH] = {0};
/* "main" of the compiler
@@ -2044,6 +2045,9 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
} /* if */
assert(litidx==0); /* literal queue should be empty (again) */
initials(ident,tag,&size,dim,numdim,enumroot);/* stores values in the literal queue */
if (tag == pc_tag_string && (numdim == 1) && !dim[numdim-1]) {
slength = glbstringread;
}
assert(size>=litidx);
if (numdim==1)
dim[0]=(int)size;
@@ -2209,6 +2213,7 @@ static int declloc(int fstatic)
do {
ident=iVARIABLE;
size=1;
slength=0;
numdim=0; /* no dimensions */
tag=pc_addtag(NULL);
if (lex(&val,&str)!=tSYMBOL) /* read in (new) token */
@@ -2304,7 +2309,12 @@ static int declloc(int fstatic)
sc_alignnext=FALSE;
} /* if */
cur_lit=litidx; /* save current index in the literal table */
if (numdim && !dim[numdim-1])
size = 0;
initials(ident,tag,&size,dim,numdim,enumroot);
if (tag == pc_tag_string && (numdim == 1) && !dim[numdim-1]) {
slength = glbstringread;
}
if (size==0)
return ident; /* error message already given */
if (numdim==1)