]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCCicode.c
Fix double pointer bug
[fw/sdcc] / 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))