more array stuff
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 6 Mar 2000 21:52:59 +0000 (21:52 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 6 Mar 2000 21:52:59 +0000 (21:52 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@174 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c

index 90cfe1a8e27a25f30e767864ca35e7e89fbd2243..883b4ba5a173933c00548e3a91b8d2e48fd32092 100644 (file)
@@ -2756,8 +2756,11 @@ operand *ast2iCode (ast *tree)
     switch (tree->opval.op) {
        
     case '[' :    /* array operation */
-       left= geniCodeRValue (left,TRUE);
-       right=geniCodeRValue (right,TRUE);                 
+       {
+           link *ltype = operandType(left);
+           left= geniCodeRValue (left,IS_PTR(ltype->next) ? TRUE : FALSE);
+           right=geniCodeRValue (right,TRUE);             
+       }
        
        return geniCodeArray (left,right);