From: Paul Floyd Date: Wed, 22 Nov 2023 07:19:47 +0000 (+0100) Subject: coverity: unreachable and unused X-Git-Tag: VALGRIND_3_23_0~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d6f6c26e4d68740e060b6821027772fe8e7a7aa;p=thirdparty%2Fvalgrind.git coverity: unreachable and unused --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index d9d746c38a..81cce9fb48 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -14405,7 +14405,6 @@ static const HChar * s390_irgen_KEB(UChar r1, IRTemp op2addr) { return s390_irgen_CxB("keb", r1, op2addr, Ity_F32, Iop_CmpF32); - return "keb"; } static const HChar * diff --git a/VEX/priv/host_ppc_defs.c b/VEX/priv/host_ppc_defs.c index ea140621e2..d4d948a3ba 100644 --- a/VEX/priv/host_ppc_defs.c +++ b/VEX/priv/host_ppc_defs.c @@ -4938,6 +4938,9 @@ Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc, default: goto bad; } + // PJF Coverity may be right but I'd reather keep the unreachable code + // "just in case" that conditions above ever change + // coverity[UNREACHABLE:FALSE] goto done; } diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 232401e60e..b38755106e 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -860,11 +860,19 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot, if (nsegments[i].hasW) seg_prot |= VKI_PROT_WRITE; if (nsegments[i].hasX) seg_prot |= VKI_PROT_EXEC; +#if defined(VGO_darwin) || defined(VGO_freebsd) + // GrP fixme kernel info doesn't have dev/inode + cmp_devino = False; + + // GrP fixme V and kernel don't agree on offsets + cmp_offsets = False; +#else cmp_offsets = nsegments[i].kind == SkFileC || nsegments[i].kind == SkFileV; cmp_devino = nsegments[i].dev != 0 || nsegments[i].ino != 0; +#endif /* Consider other reasons to not compare dev/inode */ #if defined(VGO_linux) @@ -877,14 +885,6 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot, if (filename && VG_(strstr)(filename, "/.lib-ro/")) cmp_devino = False; #endif - -#if defined(VGO_darwin) || defined(VGO_freebsd) - // GrP fixme kernel info doesn't have dev/inode - cmp_devino = False; - - // GrP fixme V and kernel don't agree on offsets - cmp_offsets = False; -#endif /* If we are doing sloppy execute permission checks then we allow segment to have X permission when we weren't expecting