mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
mib: Avoid RIP-relative addressing in mib
Using RIP relative for mib operands causes #UD exception. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
This commit is contained in:
parent
0b900cc7e1
commit
97f6faec62
@ -2426,6 +2426,12 @@ static enum ea_type process_ea(operand *input, ea *output, int bits,
|
||||
input->type |= MEMORY;
|
||||
}
|
||||
|
||||
if (bits == 64 &&
|
||||
!(IP_REL & ~input->type) && (eaflags & EAF_MIB)) {
|
||||
nasm_error(ERR_NONFATAL, "RIP-relative addressing is prohibited for mib.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (eaflags & EAF_BYTEOFFS ||
|
||||
(eaflags & EAF_WORDOFFS &&
|
||||
input->disp_size != (addrbits != 16 ? 32 : 16))) {
|
||||
|
Loading…
Reference in New Issue
Block a user