summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-10-25 00:41:00 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-10-25 00:41:00 -0700
commitae64c9d81971b853ce4ee52678db812a512597f9 (patch)
tree175db86379f59c54a91ee210d3504146610f3fa1 /assemble.c
parentc83f9de3b4d06a53a6c1f299a3c3cc6448b1f3d8 (diff)
downloadnasm-ae64c9d81971b853ce4ee52678db812a512597f9.tar.gz
assemble: use opx and opy in a few more places
Use opx and opy in a few more places where we can do so. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/assemble.c b/assemble.c
index fef9523e..bf4314d1 100644
--- a/assemble.c
+++ b/assemble.c
@@ -1072,17 +1072,19 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
ea ea_data;
int rfield;
int32_t rflags;
+ struct operand *opy = &ins->oprs[op2];
+
ea_data.rex = 0; /* Ensure ea.REX is initially 0 */
if (c <= 0177) {
- /* pick rfield from operand b */
- rflags = regflag(&ins->oprs[op1]);
- rfield = nasm_regvals[ins->oprs[op1].basereg];
+ /* pick rfield from operand b (opx) */
+ rflags = regflag(opx);
+ rfield = nasm_regvals[opx->basereg];
} else {
rflags = 0;
rfield = c & 7;
}
- if (!process_ea(&ins->oprs[op2], &ea_data, bits,
+ if (!process_ea(opy, &ea_data, bits,
ins->addr_size, rfield, rflags)) {
errfunc(ERR_NONFATAL, "invalid effective address");
return -1;