[cc65] Possible bug in dbginfo.c

From: thefox xofeht <thefox1aspekt.fi>
Date: 2013-07-02 18:17:28
There seems to be a logic bug in dbginfo.c (starting from line 2935, in the
latest GitHub repo):

    /* Symbol only valid if storage class not auto */
    if (((InfoBits & ibSymId) != 0) != (SC != CC65_CSYM_AUTO)) {
        ParseError (D, CC65_ERROR, "Only non auto symbols can have a symbol
        goto ErrorExit;

The error message doesn't match the used logic, as the equation will also
be TRUE if the storage class is not auto and it doesn't have a "sym" field.
So I believe the correct logic is this:

    if (((InfoBits & ibSymId) != 0) && (SC == CC65_CSYM_AUTO)) {

But that's based on a cursory analysis of the surrounding code, so if
somebody can verify that this fix doesn't have any shortcomings, please do


To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Jul 2 18:17:37 2013

This archive was generated by hypermail 2.1.8 : 2013-07-02 18:17:39 CEST