From: johanknol Date: Sat, 22 Mar 2003 16:57:44 +0000 (+0000) Subject: fixed bug #698231 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3e16236a4e96ed06716248ae066e69075ac8d502;p=fw%2Fsdcc fixed bug #698231 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2405 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCicode.c b/src/SDCCicode.c index dd464450..18cf40ce 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2531,6 +2531,15 @@ geniCodeDerefPtr (operand * op,int lvl) sym_link *rtype, *retype; sym_link *optype = operandType (op); + // if this is an array then array access + if (IS_ARRAY (optype)) { + // don't worry, this will be optimized out later + return geniCodeArray (op, operandFromLit (0), lvl); + } + + // just in case someone screws up + wassert (IS_PTR (optype)); + /* if this is a pointer then generate the rvalue */ if (IS_PTR (optype)) {