Skip to content

Commit 83ea23c

Browse files
Roman Bolshakovpm215
Roman Bolshakov
authored andcommitted
i386: hvf: Fix overrun of _decode_tbl1
Single opcode instructions in ff group were incorrectly processed because an overrun of _decode_tbl1[0xff] resulted in access of _decode_tbl2[0x0]. Thus, decode_sldtgroup was called instead of decode_ffgroup: 7d71: decode_sldtgroup: 1 Unimplemented handler (7d71) for 108 (ff 0) While at it correct maximum length for _decode_tbl2 and _decode_tbl3. Signed-off-by: Roman Bolshakov <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Signed-off-by: Peter Maydell <[email protected]>
1 parent 629457a commit 83ea23c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

target/i386/hvf/x86_decode.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ struct decode_x87_tbl {
454454
struct decode_tbl invl_inst = {0x0, 0, 0, false, NULL, NULL, NULL, NULL,
455455
decode_invalid};
456456

457-
struct decode_tbl _decode_tbl1[255];
458-
struct decode_tbl _decode_tbl2[255];
459-
struct decode_x87_tbl _decode_tbl3[255];
457+
struct decode_tbl _decode_tbl1[256];
458+
struct decode_tbl _decode_tbl2[256];
459+
struct decode_x87_tbl _decode_tbl3[256];
460460

461461
static void decode_x87_ins(CPUX86State *env, struct x86_decode *decode)
462462
{

0 commit comments

Comments
 (0)