i386: hvf: Don't miss 16-bit displacement
authorRoman Bolshakov <r.bolshakov@yadro.com>
Fri, 25 Jan 2019 15:47:43 +0000 (18:47 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 5 Feb 2019 15:50:18 +0000 (16:50 +0100)
In 16-bit addressing mode, when Mod = 0 and R/M = 6, decoded displacement
doesn't reach decode_linear_addr and gets lost. Instructions that
involve the combination of ModRM always get a pointer with zero offset
from the beginning of DS segment.

The change fixes drawing in F-BIRD from day 1 of '18 advent calendar.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20190125154743.14498-1-r.bolshakov@yadro.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/hvf/x86_decode.c

index 5f513c55635f2e4234eea20e525bf36514bbdd7c..9ef7d7513f80ed729e1e0559025f4b83e497e364 100644 (file)
@@ -1642,7 +1642,7 @@ void calc_modrm_operand16(CPUX86State *env, struct x86_decode *decode,
     X86Seg seg = R_DS;
 
     if (!decode->modrm.mod && 6 == decode->modrm.rm) {
-        op->ptr = (uint16_t)decode->displacement;
+        ptr = decode->displacement;
         goto calc_addr;
     }