From: epetrich Date: Thu, 27 Nov 2003 09:14:51 +0000 (+0000) Subject: * src/SDCClrange.c (findNextUseSym, rlivePoint): fixed bug #849795 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=21eb8f4eab311a95e56bc853913b9d8bd0f42564;p=fw%2Fsdcc * src/SDCClrange.c (findNextUseSym, rlivePoint): fixed bug #849795 * src/SDCCast.c (astErrors): fixed bug #846007 * src/SDCCsymt.c (checkFunction): fixed follow-up bug on bug #846007 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3031 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 5fdaf8cc..2e93c089 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-11-27 Erik Petrich + + * src/SDCClrange.c (findNextUseSym, rlivePoint): fixed bug #849795 + * src/SDCCast.c (astErrors): fixed bug #846007 + * src/SDCCsymt.c (checkFunction): fixed follow-up bug on bug #846007 + 2003-11-26 Erik Petrich * src/SDCCast.c (decorateType): disabled a transformation I added in diff --git a/src/SDCCast.c b/src/SDCCast.c index a0fe5960..e21105ca 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -5715,6 +5715,12 @@ int astErrors(ast *t) { if (t->isError) errors++; + + if (t->type == EX_VALUE + && t->opval.val->sym + && t->opval.val->sym->undefined) + errors++; + errors += astErrors(t->left); errors += astErrors(t->right); } diff --git a/src/SDCClrange.c b/src/SDCClrange.c index 58e2f616..22dada22 100644 --- a/src/SDCClrange.c +++ b/src/SDCClrange.c @@ -287,7 +287,7 @@ check_successors: if (retval) { - markAlive (ic, ebp->ech, sym->key); + if (ic) markAlive (ic, ebp->ech, sym->key); return 1; } @@ -469,10 +469,12 @@ rlivePoint (eBBlock ** ebbs, int count) alive = succ->sch->rlive; while ((succ = setNextItem (ebbs[i]->succList))) { - alive = bitVectIntersect (alive, succ->sch->rlive); + if (succ->sch) + alive = bitVectIntersect (alive, succ->sch->rlive); } - alive = bitVectCplAnd ( bitVectCopy (ebbs[i]->ech->rlive), alive); + if (ebbs[i]->ech) + alive = bitVectCplAnd ( bitVectCopy (ebbs[i]->ech->rlive), alive); for (key = 1; key < alive->size; key++) { diff --git a/src/SDCCsymt.c b/src/SDCCsymt.c index f1d91e3c..56da5bf1 100644 --- a/src/SDCCsymt.c +++ b/src/SDCCsymt.c @@ -1851,6 +1851,12 @@ checkFunction (symbol * sym, symbol *csym) fprintf (stderr, "checkFunction: %s ", sym->name); } + if (!IS_DECL(sym->type) || DCL_TYPE(sym->type)!=FUNCTION) + { + werror(E_SYNTAX_ERROR, sym->name); + return 0; + } + /* make sure the type is complete and sane */ checkTypeSanity(((symbol *)sym)->etype, ((symbol *)sym)->name);