span->items[i].data.intn = yasm_intnum_create_int(0);
/* Check for circular references */
- if ((span->bc->bc_index > span->terms[i].precbc->bc_index &&
- span->bc->bc_index <= span->terms[i].precbc2->bc_index) ||
- (span->bc->bc_index > span->terms[i].precbc2->bc_index &&
- span->bc->bc_index <= span->terms[i].precbc->bc_index))
+ if (span->id == 0 &&
+ ((span->bc->bc_index > span->terms[i].precbc->bc_index &&
+ span->bc->bc_index <= span->terms[i].precbc2->bc_index) ||
+ (span->bc->bc_index > span->terms[i].precbc2->bc_index &&
+ span->bc->bc_index <= span->terms[i].precbc->bc_index)))
yasm_error_set(YASM_ERROR_VALUE,
N_("circular reference detected"));
}
EXTRA_DIST += modules/arch/x86/tests/cpubasic-err.errwarn
EXTRA_DIST += modules/arch/x86/tests/div-err.asm
EXTRA_DIST += modules/arch/x86/tests/div-err.errwarn
+EXTRA_DIST += modules/arch/x86/tests/ea-nonzero.asm
+EXTRA_DIST += modules/arch/x86/tests/ea-nonzero.errwarn
+EXTRA_DIST += modules/arch/x86/tests/ea-nonzero.hex
EXTRA_DIST += modules/arch/x86/tests/ea-over.asm
EXTRA_DIST += modules/arch/x86/tests/ea-over.errwarn
EXTRA_DIST += modules/arch/x86/tests/ea-over.hex
--- /dev/null
+; Ticket #58
+; Also tests that this isn't seen as a circular reference.
+[bits 64]
+a:
+lea rbp,[rsi+rbp*1+(b-a)]
+b:
--- /dev/null
+48
+8d
+6c
+2e
+05
/* Handle unknown case, default to byte-sized and set as
* critical expression.
*/
- bc->len += 1;
+ x86_ea->ea.disp.size = 8;
add_span(add_span_data, bc, 1, &x86_ea->ea.disp, -128, 127);
- } else
- bc->len += x86_ea->ea.disp.size/8;
+ }
+ bc->len += x86_ea->ea.disp.size/8;
/* Handle address16 postop case */
if (insn->postop == X86_POSTOP_ADDRESS16)
if (ea && span == 1) {
/* Change displacement length into word-sized */
- if (ea->disp.size == 0) {
+ if (ea->disp.size == 8) {
ea->disp.size = (insn->common.addrsize == 16) ? 16 : 32;
x86_ea->modrm &= ~0300;
x86_ea->modrm |= 0200;