This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Impossible for entry to be NULL at this point.
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 23 Jun 2015 02:47:50 +0000 (22:47 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 27 Jun 2015 03:09:41 +0000 (23:09 -0400)
740        if (return_svp) {
           notnull: At condition entry, the value of entry cannot be NULL.
           dead_error_condition: The condition entry must be true.

CID 104777: Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression NULL inside this statement: return entry ? (void *)&ent....
741            return entry ? (void *) &HeVAL(entry) : NULL;

hv.c

diff --git a/hv.c b/hv.c
index f81de13..2fd36ee 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -742,7 +742,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
        if (flags & HVhek_FREEKEY)
            Safefree(key);
        if (return_svp) {
        if (flags & HVhek_FREEKEY)
            Safefree(key);
        if (return_svp) {
-           return entry ? (void *) &HeVAL(entry) : NULL;
+            return (void *) &HeVAL(entry);
        }
        return entry;
     }
        }
        return entry;
     }