projects
/
platform
/
upstream
/
nasm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b900cc
)
mib: Avoid RIP-relative addressing in mib
author
Jin Kyu Song
<jin.kyu.song@intel.com>
Thu, 19 Dec 2013 05:28:17 +0000
(21:28 -0800)
committer
Jin Kyu Song
<jin.kyu.song@intel.com>
Thu, 19 Dec 2013 06:27:47 +0000
(22:27 -0800)
Using RIP relative for mib operands causes #UD exception.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
assemble.c
patch
|
blob
|
history
diff --git
a/assemble.c
b/assemble.c
index
4ff9e25
..
9184800
100644
(file)
--- 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))) {