Fix double pointer bug
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 29 Feb 2000 06:18:07 +0000 (06:18 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 29 Feb 2000 06:18:07 +0000 (06:18 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@138 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c

index 46119d3ed4a3e3a36030148db3ecb7535b2ac3e7..69de4a7b0372162944ad180b3a842bfeb0075645 100644 (file)
@@ -2065,10 +2065,14 @@ operand *geniCodeDerefPtr (operand *op)
     }
     
     /* now get rid of the pointer part */
-    if (lvaluereq && IS_ITEMP(op))
+    if (lvaluereq && IS_ITEMP(op) && !IS_PTR(optype->next))
+    {
        retype = getSpec(rtype = copyLinkChain(optype)) ;
+    }
     else
+    {
        retype = getSpec(rtype = copyLinkChain(optype->next)) ;
+    }
     
     /* if this is a pointer then outputclass needs 2b updated */
     if (IS_PTR(optype))