From: johanknol Date: Fri, 8 Feb 2002 08:42:55 +0000 (+0000) Subject: fixed bug #513896 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3570da68562c27b71343d2f28927a69f5241687d;p=fw%2Fsdcc fixed bug #513896 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1905 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index 9ef1a688..7ffa31be 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1031,24 +1031,25 @@ structElemType (sym_link * stype, value * id) sym_link *type, *etype; sym_link *petype = getSpec (stype); - if (!fields || !id) - return NULL; + if (fields && id) { + + /* look for the id */ + while (fields) + { + if (strcmp (fields->rname, id->name) == 0) + { + type = copyLinkChain (fields->type); + etype = getSpec (type); + SPEC_SCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ? + SPEC_SCLS (etype) : SPEC_SCLS (petype)); + return type; + } + fields = fields->next; + } + } - /* look for the id */ - while (fields) - { - if (strcmp (fields->rname, id->name) == 0) - { - type = copyLinkChain (fields->type); - etype = getSpec (type); - SPEC_SCLS (etype) = (SPEC_SCLS (petype) == S_REGISTER ? - SPEC_SCLS (etype) : SPEC_SCLS (petype)); - return type; - } - fields = fields->next; - } werror (E_NOT_MEMBER, id->name); - + // the show must go on return newIntLink(); }