* support/Util/NewAlloc.c (freeTrace): Changed free for the gc case to not free...
[fw/sdcc] / src / SDCC.y
index d1590b2ff5ad7896e2ee7ef70afb9e18096d4008..954010939580ec2aaf9efb5c8d1a4e636cd3cfa4 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 ')'
@@ -1132,7 +1135,7 @@ statement
    | jump_statement
    | INLINEASM  ';'      {
                             ast *ex = newNode(INLINEASM,NULL,NULL);
-                           ex->values.inlineasm = Safe_calloc(1,strlen($1)+1);
+                           ex->values.inlineasm = malloc(strlen($1)+1);
                            strcpy(ex->values.inlineasm,$1);                        
                            $$ = ex;
                          }