# HG changeset patch # User kono # Date 1087635040 -32400 # Node ID d5cb084fc3f4d901f8d2b89c2d0761cf3d7246bb # Parent 46ac55e8b14c25eab9ee690d4cdf21292173f79d typedef struct tag before struct fields def. diff -r 46ac55e8b14c -r d5cb084fc3f4 mc-parse.c --- a/mc-parse.c Sat Jun 19 11:02:28 2004 +0900 +++ b/mc-parse.c Sat Jun 19 17:50:40 2004 +0900 @@ -1399,8 +1399,10 @@ if(nptr0->sc == EMPTY) nptr0=gnptr0; if(nptr0->sc == EMPTY) nptr0->sc = TAG; if(nptr0->sc != TAG) error(TYERR); - fields = caddr(nptr0->ty); - disp = cadr(nptr0->ty); + if (nptr0->ty) { + fields = caddr(nptr0->ty); + disp = cadr(nptr0->ty); + } conv->comment_(' '); type0 = list4(s,disp,fields,(int)nptr0); } @@ -3358,9 +3360,15 @@ /* type = list4(s,disp,fields,tag_nptr); */ static int -search_struct_type(int t,char *name,int *dsp) +search_struct_type(int type,char *name,int *dsp) { - t = caddr(t); + int t; + NMTBL *nptr0; + t = caddr(type); + if (t==0) { + nptr0=(NMTBL*)cadddr(type); + t = caddr(type) = caddr(nptr0->ty); + } for(;t;t = cadr(t)) { if (neqname((char *)caddr(t),name)==0) { *dsp = cadddr(t);