when adding to pointer, cast right side to int if
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 30 Sep 2000 21:38:12 +0000 (21:38 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 30 Sep 2000 21:38:12 +0000 (21:38 +0000)
pointer size > 1

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@433 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c

index 802abd7b4ee07e56c9fac0e5ce8ecb71f544d1cf..941cbb78b833907bbb76b49a5d64a8b233ad2aa1 100644 (file)
@@ -1607,6 +1607,8 @@ operand *geniCodeAdd (operand *left, operand *right )
        size = 
            operandFromLit(getSize(ltype->next));
        right = geniCodeMultiply (right ,size);
+       if (getSize(ltype) > 1) 
+               right = geniCodeCast(INTTYPE,right,TRUE);
        resType = copyLinkChain(ltype);
     }
     else { /* make them the same size */