more function pointer issues
[fw/sdcc] / src / SDCCdflow.c
index dee5cbb9cda6c8e09adabb27b79a5afb7d03d1f7..afdba8eacaf113915ca97562e9176e0e35c98fa3 100644 (file)
@@ -252,9 +252,16 @@ usedBetweenPoints (operand * op, iCode * start, iCode * end)
       /* true if there is a call       */
       if (IS_PARM (op) &&
          (lic->op == CALL ||
-          lic->op == PCALL))
-       if (isParameterToCall (IC_ARGS (lic), op))
+          lic->op == PCALL)) {
+       value *args;
+       if (lic->op == CALL) {
+         args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type);
+       } else {
+         args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type->next);
+       }
+       if (isParameterToCall (args, op))
          return 1;
+      }
 
       if (SKIP_IC2 (lic))
        continue;
@@ -310,9 +317,14 @@ usedInRemaining (operand * op, iCode * ic)
          return true */
       if (lic->op == CALL || lic->op == PCALL)
        {
-
+         value *args;
+         if (lic->op == CALL) {
+           args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type);
+         } else {
+           args=FUNC_ARGS(OP_SYMBOL(IC_LEFT(lic))->type->next);
+         }
          if ((IS_PARM (op) &&
-              isParameterToCall (IC_ARGS (lic), op)) ||
+              isParameterToCall (args, op)) ||
              isOperandGlobal (op))
            return lic;
        }