make pcall use correct chain
[fw/sdcc] / src / SDCCast.c
index 15f59285a84add354e7611937d698e1eadc1f75c..26cd0353fc5f154fa3db4b351c127390a5869e36 100644 (file)
@@ -1183,7 +1183,6 @@ bool constExprTree (ast *cexpr) {
       return FALSE;
     case EX_OP:
       if (cexpr->opval.op==ARRAYINIT) {
-       fprintf (stderr, "skipping arrayinit\n");
        // this is a list of literals
        return TRUE;
       }
@@ -1645,6 +1644,9 @@ isConformingBody (ast * pbody, symbol * sym, ast * body)
       /*       function call        */
 /*----------------------------*/
     case CALL:
+       /* if local & not passed as paramater then ok */
+       if (sym->level && !astHasSymbol(pbody->right,sym)) 
+           return TRUE;
       return FALSE;
 
 /*------------------------------------------------------------------*/
@@ -4877,7 +4879,9 @@ void ast_print (ast * tree, FILE *outfile, int indent)
                /*----------------------------*/
        case RETURN:
                fprintf(outfile,"RETURN (%p) type (",tree);
-               printTypeChain(tree->right->ftype,outfile);
+               if (tree->right) {
+                   printTypeChain(tree->right->ftype,outfile);
+               }
                fprintf(outfile,")\n");
                ast_print(tree->right,outfile,indent+2);
                return ;