diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index 4af22d478e0f..94aa49267763 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -701,12 +701,6 @@ decode_modrm(struct vie *vie) break; } - /* Figure out immediate operand size (if any) */ - if (vie->op.op_flags & VIE_OP_F_IMM) - vie->imm_bytes = 4; - else if (vie->op.op_flags & VIE_OP_F_IMM8) - vie->imm_bytes = 1; - done: vie_advance(vie); @@ -822,6 +816,12 @@ decode_immediate(struct vie *vie) int32_t signed32; } u; + /* Figure out immediate operand size (if any) */ + if (vie->op.op_flags & VIE_OP_F_IMM) + vie->imm_bytes = 4; + else if (vie->op.op_flags & VIE_OP_F_IMM8) + vie->imm_bytes = 1; + if ((n = vie->imm_bytes) == 0) return (0);