From: kvigor Date: Mon, 28 Feb 2000 05:03:43 +0000 (+0000) Subject: Make &array[const] compile X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=8b71ea9698b188b0616f8965a5c9e838d572f8a2;p=fw%2Fsdcc Make &array[const] compile git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@134 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCicode.c b/src/SDCCicode.c index 7213568f..46119d3e 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2074,7 +2074,16 @@ operand *geniCodeDerefPtr (operand *op) if (IS_PTR(optype)) setOClass(optype,retype); - + #if 1 + /* This block moved here from its original location + * ten lines later by KV, 2/27/2000. + * + * This allows code of the form "&array[const]" to + * compile properly. + */ + if (!lvaluereq) + op = geniCodeRValue(op, TRUE); + #endif op->isGptr = IS_GENPTR(optype); /* if the pointer was declared as a constant */ @@ -2088,8 +2097,11 @@ operand *geniCodeDerefPtr (operand *op) IS_CHAR(rtype) || IS_FLOAT(rtype) ); + #if 0 + /* Moved upwards */ if (!lvaluereq) op = geniCodeRValue(op,TRUE); + #endif setOperandType(op,rtype); return op;