From 8a4f40cdb439d95b386a73cd4cb8f8f224e7a7b5 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost <ehabkost@redhat.com> Date: Thu, 17 Sep 2009 14:06:03 -0300 Subject: [PATCH 22/38] fix var may be used uninitialized RH-Author: Juan Quintela <quintela@redhat.com> Message-id: <0fd7a473d83d0ba5a6429936664f154d4ec2017b.1249487147.git.quintela@redhat.com> Patchwork-id: 3190 O-Subject: [PATCH 25/38] fix var may be used uninitialized Bugzilla: 515749 RH-Acked-by: Kevin Wolf <kwolf@redhat.com> RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com> RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com> RH-Acked-by: Markus Armbruster <armbru@redhat.com> load_segments(&var,...) assigns the value of vars. Gcc is not so intelligent, help it Signed-off-by: Juan Quintela <quintela@redhat.com> --- qemu/target-i386/op_helper.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu/target-i386/op_helper.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qemu/target-i386/op_helper.c b/qemu/target-i386/op_helper.c index 6e0e32e..7887196 100644 --- a/qemu/target-i386/op_helper.c +++ b/qemu/target-i386/op_helper.c @@ -211,7 +211,7 @@ static inline void get_ss_esp_from_tss(uint32_t *ss_ptr, /* XXX: merge with load_seg() */ static void tss_load_seg(int seg_reg, int selector) { - uint32_t e1, e2; + uint32_t e1 = 0, e2 = 0; int rpl, dpl, cpl; if ((selector & 0xfffc) != 0) { @@ -639,7 +639,7 @@ static void do_interrupt_protected(int intno, int is_int, int error_code, target_ulong ptr, ssp; int type, dpl, selector, ss_dpl, cpl; int has_error_code, new_stack, shift; - uint32_t e1, e2, offset, ss, esp, ss_e1, ss_e2; + uint32_t e1, e2, offset, ss = 0, esp, ss_e1 = 0, ss_e2 = 0; uint32_t old_eip, sp_mask; has_error_code = 0; @@ -2154,7 +2154,7 @@ void helper_ljmp_protected(int new_cs, target_ulong new_eip, int next_eip_addend) { int gate_cs, type; - uint32_t e1, e2, cpl, dpl, rpl, limit; + uint32_t e1 = 0, e2 = 0, cpl, dpl, rpl, limit; target_ulong next_eip; if ((new_cs & 0xfffc) == 0) @@ -2270,8 +2270,8 @@ void helper_lcall_protected(int new_cs, target_ulong new_eip, int shift, int next_eip_addend) { int new_stack, i; - uint32_t e1, e2, cpl, dpl, rpl, selector, offset, param_count; - uint32_t ss, ss_e1, ss_e2, sp, type, ss_dpl, sp_mask; + uint32_t e1 = 0, e2 = 0, cpl, dpl, rpl, selector, offset, param_count; + uint32_t ss = 0, ss_e1 = 0, ss_e2 = 0, sp, type, ss_dpl, sp_mask; uint32_t val, limit, old_sp_mask; target_ulong ssp, old_ssp, next_eip; @@ -2547,7 +2547,7 @@ static inline void helper_ret_protected(int shift, int is_iret, int addend) { uint32_t new_cs, new_eflags, new_ss; uint32_t new_es, new_ds, new_fs, new_gs; - uint32_t e1, e2, ss_e1, ss_e2; + uint32_t e1 = 0, e2 = 0, ss_e1 = 0, ss_e2 = 0; int cpl, dpl, rpl, eflags_mask, iopl; target_ulong ssp, sp, new_eip, new_esp, sp_mask; @@ -2748,7 +2748,7 @@ static inline void helper_ret_protected(int shift, int is_iret, int addend) void helper_iret_protected(int shift, int next_eip) { int tss_selector, type; - uint32_t e1, e2; + uint32_t e1 = 0, e2 = 0; /* specific case for TSS */ if (env->eflags & NT_MASK) { -- 1.6.3.rc4.29.g8146