develooper Front page | perl.perl5.porters | Postings from April 2014

an easy (?) way to knock off ~100 Coverity issues: smartify generatedXS

Thread Next
From:
Jarkko Hietaniemi
Date:
April 23, 2014 18:29
Subject:
an easy (?) way to knock off ~100 Coverity issues: smartify generatedXS
Message ID:
53580665.3010901@iki.fi
It seems that about 100 of the Coverity issues are because of this 
(Util.c of ext/Hash-Util):

323 XS_EUPXS(XS_Hash__Util_hash_seed)
324 {
325    dVAR; dXSARGS;
326    if (items != 0)
327       croak_xs_usage(cv,  "");
328    PERL_UNUSED_VAR(ax); /* -Wall */
329    SP -= items;
330    {
331 #line 68 "Util.xs"
332    mXPUSHs(newSVpvn((char *)PERL_HASH_SEED,PERL_HASH_SEED_BYTES));
333    XSRETURN(1);
334 #line 335 "Util.c"
    	
CID 29189 (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: PL_stack_sp = sp;.

335        PUTBACK;
336        return;
337    }
338 }

That PUTBACK; return; is always generated, even when we generate an 
XSRETURN.





Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About