Re: [cc65] broken string arithmetic

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-07-15 22:39:02
Hi!

On Tue, Jul 13, 2004 at 05:13:52PM +0200, MagerValp wrote:
> This piece of broken code:
[...]
> produces the following compilation error with 2.10.0:

Fixed. Here is the patch (relative to a patched 2.10.1):

-----------------------------------------------------------------------------
diff -c -b -r1.86.2.1.2.1 expr.c
*** src/cc65/expr.c     23 May 2004 12:25:15 -0000      1.86.2.1.2.1
--- src/cc65/expr.c     15 Jul 2004 20:29:14 -0000
***************
*** 923,928 ****
--- 923,929 ----
      if (CurTok.Tok == TOK_SCONST) {
        lval->Flags = E_MCONST | E_TLIT;
                lval->ConstVal = CurTok.IVal;
+         lval->Name = LiteralPoolLabel;
        lval->Type  = GetCharArrayType (GetLiteralPoolOffs () - CurTok.IVal);
        NextToken ();
        return 0;
-----------------------------------------------------------------------------

The solution is in fact more a workaround than a real solution for the
problem, but the code in question has already been rewritten for the next
major release, so there's no reason to put more effort into a better solution
- provided that the workaround is ok of course.

Thanks for the bug report!

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jul 15 22:39:07 2004

This archive was generated by hypermail 2.1.8 : 2004-07-15 22:39:15 CEST