From 3d96ea651a122266494af9106c4b574575cd3dfa Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Thu, 9 Oct 2025 16:10:35 -0700 Subject: [PATCH] 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) --- asm/assemble.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asm/assemble.c b/asm/assemble.c index da12940a5..911962c65 100644 --- a/asm/assemble.c +++ b/asm/assemble.c @@ -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;