From df68b7ad76b0a7a11bb5ff461efb05e1bf22d5e9 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 11 Oct 2007 06:05:41 +0000 Subject: [PATCH] Fix explicitly-overridden short-only instructions such as "loop short label". These would incorrectly be treated as errors. svn path=/trunk/yasm/; revision=2001 --- modules/arch/x86/tests/genopcode.asm | 3 +++ modules/arch/x86/tests/genopcode.hex | 7 +++++++ modules/arch/x86/x86id.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/arch/x86/tests/genopcode.asm b/modules/arch/x86/tests/genopcode.asm index f37695d3..357c010e 100644 --- a/modules/arch/x86/tests/genopcode.asm +++ b/modules/arch/x86/tests/genopcode.asm @@ -168,6 +168,9 @@ jmp near label jmp far [label] jmp far dword [label] call far word [label] +loop short label +jcxz short label +jecxz short label [bits 16] push si push esi diff --git a/modules/arch/x86/tests/genopcode.hex b/modules/arch/x86/tests/genopcode.hex index d6a562d2..37b3cf94 100644 --- a/modules/arch/x86/tests/genopcode.hex +++ b/modules/arch/x86/tests/genopcode.hex @@ -482,6 +482,13 @@ ff 1e b9 01 +e2 +d3 +e3 +d1 +67 +e3 +ce 56 66 56 diff --git a/modules/arch/x86/x86id.c b/modules/arch/x86/x86id.c index 7312913e..0687ef15 100644 --- a/modules/arch/x86/x86id.c +++ b/modules/arch/x86/x86id.c @@ -515,10 +515,10 @@ x86_finalize_jmp(yasm_bytecode *bc, yasm_bytecode *prev_bc, } } - if ((jmp->op_sel == JMP_SHORT_FORCED) && (jmp->nearop.len == 0)) + if ((jmp->op_sel == JMP_SHORT_FORCED) && (jmp->shortop.len == 0)) yasm_error_set(YASM_ERROR_TYPE, N_("no SHORT form of that jump instruction exists")); - if ((jmp->op_sel == JMP_NEAR_FORCED) && (jmp->shortop.len == 0)) + if ((jmp->op_sel == JMP_NEAR_FORCED) && (jmp->nearop.len == 0)) yasm_error_set(YASM_ERROR_TYPE, N_("no NEAR form of that jump instruction exists")); -- 2.40.0