fixed bug #463839
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 23 Sep 2001 13:44:10 +0000 (13:44 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 23 Sep 2001 13:44:10 +0000 (13:44 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1298 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c
src/SDCCsymt.c

index 89b365c48ffe9104ca8aa360620cdf9ea4129c2c..0a429066c6c0114f565ce4224a0d5a1aeac55ca7 100644 (file)
@@ -1107,7 +1107,7 @@ gatherAutoInit (symbol * autoChain)
          /* insert the symbol into the symbol table */
          /* with level = 0 & name = rname       */
          newSym = copySymbol (sym);
-         addSym (SymbolTab, newSym, newSym->name, 0, 0, 1);
+         addSym (SymbolTab, newSym, newSym->rname, 0, 0, 1);
 
          /* now lift the code to main */
          if (IS_AGGREGATE (sym->type))
index 97634105617769ecf20aeada191e8234d3126715..7164549b792881d7cc9ad45c2dc1d1cfc554dc16 100644 (file)
@@ -217,13 +217,12 @@ findSymWithLevel (bucket ** stab, symbol * sym)
    **/
   while (bp)
     {
-
       if (strcmp (bp->name, sym->name) == 0 && bp->level <= sym->level)
        {
          /* if this is parameter then nothing else need to be checked */
          if (((symbol *) (bp->sym))->_isparm)
            return (bp->sym);
-         /* if levels match then block numbers hsould also match */
+         /* if levels match then block numbers should also match */
          if (bp->level && bp->level == sym->level && bp->block == sym->block)
            return (bp->sym);
          /* if levels don't match then we are okay */
@@ -957,7 +956,7 @@ addSymChain (symbol * symHead)
          then check if the type match, if the types match then
          delete the current entry and add the new entry      */
       if ((csym = findSymWithLevel (SymbolTab, sym)) &&
-         csym->level == sym->level) {
+         csym->level == sym->level && csym->localof == sym->localof) {
        
        /* one definition extern ? */
        if (IS_EXTERN (csym->etype) || IS_EXTERN (sym->etype)) {
@@ -2278,6 +2277,11 @@ initCSupport ()
 
   int bwd, su, muldivmod, tofrom, rlrr;
 
+  if (getenv("SDCC_NO_C_SUPPORT")) {
+    /* for debugging only */
+    return;
+  }
+
   floatType = newFloatLink ();
 
   for (bwd = 0; bwd < 3; bwd++)