summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-12-18 21:28:17 -0800
committerJin Kyu Song <jin.kyu.song@intel.com>2013-12-18 22:27:47 -0800
commit97f6faec62979ef5db9c0f4b42e127f4f913115e (patch)
tree69441eb984c0ca946fe159eda23230f739bdaa0b
parent0b900cc7e1f197364fd3919f7050bf4dd10d112c (diff)
downloadnasm-97f6faec62979ef5db9c0f4b42e127f4f913115e.tar.gz
nasm-97f6faec62979ef5db9c0f4b42e127f4f913115e.tar.bz2
nasm-97f6faec62979ef5db9c0f4b42e127f4f913115e.zip
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>
-rw-r--r--assemble.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/assemble.c b/assemble.c
index 4ff9e25..9184800 100644
--- a/assemble.c
+++ b/assemble.c
@@ -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))) {