]> git.gag.com Git - fw/sdcc/commitdiff
a more general fix for bug #466586
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 2 Oct 2001 12:20:14 +0000 (12:20 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 2 Oct 2001 12:20:14 +0000 (12:20 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1343 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCC.y
src/mcs51/gen.c

index d1590b2ff5ad7896e2ee7ef70afb9e18096d4008..952d35322d9006532e873baca4ff904f14dd1479 100644 (file)
@@ -777,12 +777,6 @@ struct_declarator_list
 
 struct_declarator
    : declarator 
-     {
-       // if this was a function declarator, remove the symbol args (if any)
-       if (IS_FUNC($1->etype)) {
-        cleanUpLevel(SymbolTab,NestLevel+1);
-       }
-     }
    | ':' constant_expr  {  
                            $$ = newSymbol (genSymName(NestLevel),NestLevel) ; 
                            $$->bitVar = (int) floatFromVal(constExprValue($2,TRUE));
@@ -927,6 +921,15 @@ declarator2
             /* nest level was incremented to take care of the parms  */
             NestLevel-- ;
             currBlockno--;
+
+            // if this was a pointer to a function, remove the symbol args
+            // (if any)
+            if (IS_PTR($1->type) && IS_FUNC($1->etype)) {
+              cleanUpLevel(SymbolTab,NestLevel+1);
+              /* fprintf (stderr, "Removed parm symbols of %s in line %d\n", 
+                 $1->name, yylineno); */
+            }
+            
             $$ = $1;
          }
    | declarator2 '(' parameter_identifier_list ')'
index 3d9987a3fe5a5be24c1960a61e4c38d26f654fd9..4a7e6aba7b036fcb49c26500b5441c5aa1cbc716 100644 (file)
@@ -1442,7 +1442,6 @@ saveRegisters (iCode * lic)
   int i;
   iCode *ic;
   bitVect *rsave;
-  sym_link *detype;
 
   /* look for call */
   for (ic = lic; ic; ic = ic->next)
@@ -1494,10 +1493,8 @@ saveRegisters (iCode * lic)
        if (bitVectBitValue (rsave, i))
          emitcode ("push", "%s", mcs51_regWithIdx (i)->dname);
       }
-
-  detype = getSpec (operandType (IC_LEFT (ic)));
-
 }
+
 /*-----------------------------------------------------------------*/
 /* unsaveRegisters - pop the pushed registers                      */
 /*-----------------------------------------------------------------*/