From: bernhardheld Date: Mon, 12 Jan 2004 20:57:35 +0000 (+0000) Subject: * src/SDCCast.c (decorateType): fixed bug introduced today X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a8bdd6989affefd2ed0b0d223308ed5515ebe9b7;p=fw%2Fsdcc * src/SDCCast.c (decorateType): fixed bug introduced today git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3119 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 6004c213..ef911f5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-01-12 Bernhard Held + + * src/SDCCast.c (decorateType): fixed bug introduced today + 2004-01-12 Borut Razem * src/SDCC.lex, support/Util/SDCCerr.h, support/Util/SDCCerr.c, diff --git a/src/SDCCast.c b/src/SDCCast.c index 2c13fef7..25681f1a 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -1782,7 +1782,7 @@ isConformingBody (ast * pbody, symbol * sym, ast * body) if (astHasVolatile (pbody->left)) return FALSE; - + if (astHasDeref(pbody->right)) return FALSE; return isConformingBody (pbody->left, sym, body) && @@ -3488,11 +3488,15 @@ decorateType (ast * tree) } if (tree->opval.op == '>') { - tree->opval.op = '!'; - tree->right = NULL; - LRVAL (tree) = 1; - TTYPE (tree) = TETYPE (tree) = newCharLink (); - return tree; + /* if the parent is an ifx, then we could do */ + /* return tree->left; */ + tree->opval.op = '?'; + tree->right = newNode (':', + newAst_VALUE (constVal ("1")), + tree->right); /* val 0 */ + tree->right->lineno = tree->lineno; + tree->right->left->lineno = tree->lineno; + decorateType (tree->right); } } /* if they are both literal then */ @@ -5562,7 +5566,7 @@ void ast_print (ast * tree, FILE *outfile, int indent) ast_print(tree->left,outfile,indent+2); ast_print(tree->right,outfile,indent+2); return ; - + /*------------------------------------------------------------------*/ /*----------------------------*/ /* assignment operators */