From: Carl Love Date: Mon, 31 Oct 2022 17:29:31 +0000 (-0400) Subject: Bug 444110 priv/guest_ppc_toIR.c: warning: duplicated 'if' condition X-Git-Tag: VALGRIND_3_21_0~278 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=873f3766955c4f5caacc014dbe3d4fa0a4f6f712;p=valgrind.git Bug 444110 priv/guest_ppc_toIR.c: warning: duplicated 'if' condition The compiler reported a duplicated condition in VEX/priv/guest_ppc_toIR.c The handling of the plbz and xxpermx instructions have the same if/elseif conditions. The else if condition for the plbz instruction was wrong. The elseif statement should be checking for pType2 not pType1. The plbz instruction was inadvertently being handled by the else statement for the lbz instruction. This patch fixes the checking for the plbz and lbz instructions. --- diff --git a/NEWS b/NEWS index 614ce44a36..208d8afab7 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,7 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +444110 priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition. To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index 41d7bf65c0..16181768e4 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -36012,11 +36012,11 @@ DisResult disInstr_PPC_WRK ( // splat instructions: xxpermx if (dis_vector_permute_prefix( prefix, theInstr, abiinfo )) goto decode_success; - } else if (is_prefix && ( ptype == pType1 ) ) { // plbz: load instruction + } else if (is_prefix && ( ptype == pType2 ) ) { // plbz: load instruction if ( !(allow_isa_3_1) ) goto decode_noIsa3_1; if (dis_int_load_prefix( prefix, theInstr )) goto decode_success; - } else { // lbz: load instruction + } else if (!is_prefix) { // lbz: load instruction if (dis_int_load_prefix( prefix, theInstr )) goto decode_success; }