On 15/05/2018 19:35, [email protected] wrote:
> From: Lucian Petrut <[email protected]>
> 
> This patch fixes a few compiler warnings, especially in case of
> x86 targets, where the number of registers was not properly handled
> and could cause an overflow.
> 
> Signed-off-by: Alessandro Pilotti <[email protected]>
> Signed-off-by: Justin Terry (VM) <[email protected]>
> Signed-off-by: Lucian Petrut <[email protected]>
> ---
>  target/i386/whpx-all.c | 49 +++++++++++++++++++++++++++++++++++--------------
>  1 file changed, 35 insertions(+), 14 deletions(-)
> 
> diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c
> index 0a29d56..2fd3397 100644
> --- a/target/i386/whpx-all.c
> +++ b/target/i386/whpx-all.c
> @@ -226,24 +226,31 @@ static void whpx_set_registers(CPUState *cpu)
>      struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu);
>      struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
>      X86CPU *x86_cpu = X86_CPU(cpu);
> -    struct whpx_register_set vcxt = {0};
> +    struct whpx_register_set vcxt;
>      HRESULT hr;
> -    int idx = 0;
> +    int idx;
> +    int idx_next;
>      int i;
>      int v86, r86;
>  
>      assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
>  
> +    memset(&vcxt, 0, sizeof(struct whpx_register_set));

This change does not seem like an improvement, can you send a patch with
the bugfix only?

Thanks,

Paolo

Reply via email to