force aggregate arguments to varargs functions to generic pointers as well.
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 30 Jan 2001 17:57:59 +0000 (17:57 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 30 Jan 2001 17:57:59 +0000 (17:57 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@548 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCast.c

index 82574d72afc6bfd0331c3b48ae5e3b365678561d..7fd9cfca74535d34b5ca1527beb9dfe9cf8fbb06 100644 (file)
@@ -593,10 +593,13 @@ int processParms (ast *func, value *defParm,
     {
         ast *newType = NULL;
         
+        printf("oogie ");
+        
        if (IS_CAST_OP(actParm) 
         || (IS_AST_LIT_VALUE(actParm) && actParm->values.literalFromCast))
        {
           /* Parameter was explicitly typecast; don't touch it. */
+          printf("typecast.\n");
           return 0;
        }    
         
@@ -613,6 +616,12 @@ int processParms (ast *func, value *defParm,
             DCL_TYPE(newType->opval.lnk) = GPOINTER;
         }
         
+        if (IS_AGGREGATE(actParm->ftype))
+        {
+            newType = newAst_LINK(copyLinkChain(actParm->ftype));
+            DCL_TYPE(newType->opval.lnk) = GPOINTER;
+        }
+        
         if (newType)
         {
            /* cast required; change this op to a cast. */
@@ -623,6 +632,12 @@ int processParms (ast *func, value *defParm,
            actParm->left = newType;
            actParm->right= parmCopy;
            decorateType(actParm);
+           
+           printf("boogie\n");
+        }
+        else
+        {
+            printf("nada\n");
         }
         
         return 0;