* src/SDCCsymt.c (compareType): fixed bug 1309013
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 12 Feb 2008 15:09:16 +0000 (15:09 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 12 Feb 2008 15:09:16 +0000 (15:09 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5004 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCsymt.c

index a2e75c5e8fa6b2bf2d96cd25669e081786d87e0d..890f06f17162261762b5329ca92a708730463597 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-12 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * src/SDCCsymt.c (compareType): fixed bug 1309013
+
 2008-02-09 Borut Razem <borut.razem AT siol.net>
 
        * src/SDCCval.c, src/SDCCval.h:
index 755683574e86a3b55f63832107b52a87eeb73102..e950c5800ae4f118f7519cc6661b917558659176 100644 (file)
@@ -2071,7 +2071,15 @@ compareType (sym_link * dest, sym_link * src)
                 return -1;
               if (IS_FUNC (dest->next) && IS_VOID(src->next))
                 return -1;
-              return compareType (dest->next, src->next);
+              if (IS_VOID (src->next) && IS_VOID (dest->next))
+                return 1;
+              if ((IS_VOID (src->next) && !IS_VOID (dest->next)) ||
+                  (!IS_VOID (src->next) && IS_VOID (dest->next)) )
+                return -1;
+              if (compareType (dest->next, src->next) == 1)
+                return 1;
+              else
+                return 0;
             }
 
           if (DCL_TYPE (src) == DCL_TYPE (dest))
@@ -2080,7 +2088,15 @@ compareType (sym_link * dest, sym_link * src)
                 {
                   //checkFunction(src,dest);
                 }
-              return compareType (dest->next, src->next);
+              if (IS_VOID (src->next) && IS_VOID (dest->next))
+                return 1;
+              if ((IS_VOID (src->next) && !IS_VOID (dest->next)) ||
+                  (!IS_VOID (src->next) && IS_VOID (dest->next)) )
+                return -1;
+              if (compareType (dest->next, src->next) == 1)
+                return 1;
+              else
+                return 0;
             }
           if (IS_PTR (dest) && IS_GENPTR (src) && IS_VOID(src->next))
             {