* src/SDCCast.c (decorateType): fixed bug introduced today
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 12 Jan 2004 20:57:35 +0000 (20:57 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 12 Jan 2004 20:57:35 +0000 (20:57 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3119 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCast.c

index 6004c2139431546b51d0684bdfab4e4c2531c3af..ef911f5ce5a9956a2ccd6b68c54d12ac535e786d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-01-12 Bernhard Held <bernhard@bernhardheld.de>
+
+       * src/SDCCast.c (decorateType): fixed bug introduced today
+
 2004-01-12  Borut Razem <borut.razem@siol.net>
 
        * src/SDCC.lex, support/Util/SDCCerr.h, support/Util/SDCCerr.c,
index 2c13fef7d8effee0cf21f90441e3c8b6d23c65a6..25681f1a62788c0556505a7d1305e7702873a08c 100644 (file)
@@ -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    */