From 3df17c583bad53f0ee98c8a2464222431584a62b Mon Sep 17 00:00:00 2001 From: MaartenBrock Date: Wed, 23 Jan 2008 22:13:38 +0000 Subject: [PATCH] * src/SDCCast.c (createRMW): fixed bug 1582651 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4999 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++++ src/SDCCast.c | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c846a25..437f44b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-23 Maarten Brock + + * src/SDCCast.c (createRMW): fixed bug 1582651 + 2008-01-20 Borut Razem * src/SDCCcse.c: partially fixed enhancement request diff --git a/src/SDCCast.c b/src/SDCCast.c index 75cc641b..a2a67a57 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -391,6 +391,9 @@ ast * createRMW (ast *target, unsigned op, ast *operand) tempvar1 = replaceAstWithTemporary(&(target->left)); if (hasSEFcalls(target->right)) tempvar2 = replaceAstWithTemporary(&(target->right)); + } else if ((target->opval.op == INC_OP) || (target->opval.op == DEC_OP)) { + /* illegal pre/post-increment/decrement */ + werrorfl (target->filename, target->lineno, E_LVALUE_REQUIRED, "="); } else { /* we would have to handle '.', but it is not generated any more */ wassertl(target->opval.op != '.', "obsolete opcode in tree"); @@ -1104,8 +1107,7 @@ createIvalCharPtr (ast * sym, sym_link * type, ast * iexpr, ast *rootVal) && IS_ARRAY (iexpr->ftype))) return newNode ('=', sym, iexpr); - /* left side is an array so we have to assign each */ - /* element */ + /* left side is an array so we have to assign each element */ if ((IS_LITERAL (iexpr->etype) || SPEC_SCLS (iexpr->etype) == S_CODE) && IS_ARRAY (iexpr->ftype)) @@ -1553,7 +1555,7 @@ constExprValue (ast * cexpr, int check) { return cexpr->opval.val; } - return NULL; + return NULL; } /*-----------------------------------------------------------------*/ -- 2.47.2