assemble: weaken the test for "absolute address can not be RIP-relative"

The test for "absolute address can not be RIP-relative" is too strict
and causes false positive failures.

Fixes: https://github.com/netwide-assembler/nasm/issues/145
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2025-10-09 16:10:35 -07:00
parent a8a1dc2b0c
commit 3d96ea651a

View file

@ -3462,8 +3462,7 @@ static int process_ea(operand *input, int rfield, opflags_t rflags,
input->type |= IP_REL;
}
if ((input->type & IP_REL) == IP_REL) {
if (input->segment == NO_SEG ||
(input->opflags & OPFLAG_RELATIVE)) {
if (!pass_first() && absolute_op(input)) {
nasm_warn(WARN_EA_ABSOLUTE,
"absolute address can not be RIP-relative");
input->type &= ~IP_REL;