Skip to content

Commit 4094093

Browse files
committed
parser: fix invalid segment override on EQU FAR pointers
The parser incorrectly treated colons as memory segment overrides inside EQU directives because of an inverted far_jmp_ok check. This regression was introduced in commit 8981724. Removing the incorrect negation restores proper parsing of FAR pointer constants.
1 parent aa12d33 commit 4094093

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

asm/parser.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,17 @@ insn *parse_line(char *buffer, insn *result, const int bits)
11081108
*/
11091109
} else if (mref || !far_jmp_ok) {
11101110
/* segment override? */
1111-
mref = true;
1111+
if (!mref && (!ok_reg || !IS_SREG(value->type))) {
1112+
i = stdscan(NULL, &tokval);
1113+
goto mref_more;
1114+
} else {
1115+
mref = true;
1116+
if (!ok_reg || !IS_SREG(value->type)) {
1117+
nasm_nonfatal("invalid segment override");
1118+
}
1119+
i = stdscan(NULL, &tokval);
1120+
goto mref_more;
1121+
}
11121122

11131123
/*
11141124
* Process the segment override.

0 commit comments

Comments
 (0)