> Fixes: 1e25327b244a ("target/i386/emulate: Allow instruction decoding from 
> stream")
> cc: qemu-stable
> Signed-off-by: Bernhard Beschow <[email protected]>
> Reviewed-by: Mohamed Mediouni <[email protected]>
> ---
>  target/i386/emulate/x86_decode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/i386/emulate/x86_decode.c 
> b/target/i386/emulate/x86_decode.c
> index 6ad03b71b0..7bbcd2a9a2 100644
> --- a/target/i386/emulate/x86_decode.c
> +++ b/target/i386/emulate/x86_decode.c
> @@ -2088,8 +2088,6 @@ static void decode_opcodes(CPUX86State *env, struct 
> x86_decode *decode)
>  
>  static uint32_t decode_opcode(CPUX86State *env, struct x86_decode *decode)
>  {
> -    memset(decode, 0, sizeof(*decode));
> -
>      decode_prefix(env, decode);
>      set_addressing_size(env, decode);
>      set_operand_size(env, decode);
> @@ -2101,6 +2099,8 @@ static uint32_t decode_opcode(CPUX86State *env, struct 
> x86_decode *decode)
>  
>  uint32_t decode_instruction(CPUX86State *env, struct x86_decode *decode)
>  {
> +    memset(decode, 0, sizeof(*decode));
> +
>      return decode_opcode(env, decode);
>  }
>  
> -- 
> 2.50.1 (Apple Git-155)

Tested-by: Magnus Kulke <[email protected]>

makes sense, thx.

Reply via email to