From a057cc27cce291fdaab541a7f3c0cb2247edaae1 Mon Sep 17 00:00:00 2001 From: SCPCD Date: Mon, 9 Jul 2012 15:28:06 +0000 Subject: [PATCH] No more crash whith some assembler file : the mask applied to "attr" in "fixup" function was wrong. With a mask of 0x0200, other FU_xxx can match and unexpected behavior will arise. --- sect.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sect.c b/sect.c index 0a23b4b..7db71a3 100644 --- a/sect.c +++ b/sect.c @@ -266,8 +266,7 @@ int fixup(WORD attr, LONG loc, TOKEN * fexpr) // no expression if it's just a mark. This code assumes 16 bit WORDs and 32 bit LONGs if (*fexpr == SYMBOL && fexpr[2] == ENDEXPR) { - //if ((attr & 0x0F00) == FU_JR) { - if ((attr & 0x0200) == FU_JR) + if ((attr & 0x0F00) == FU_JR) // SCPCD : correct bit mask for attr (else other FU_xxx will match) NYAN ! { i = 18; // Just a single symbol } @@ -336,8 +335,7 @@ int fixup(WORD attr, LONG loc, TOKEN * fexpr) *fchptr.lp++ = (LONG)fexpr[1]; } - //if ((attr & 0x0F00) == FU_JR) { - if ((attr & 0x0200) == FU_JR) + if ((attr & 0x0F00) == FU_JR) // SCPCD : correct bit mask for attr (else other FU_xxx will match) NYAN ! { if (orgactive) *fchptr.lp++ = orgaddr; -- 2.37.2