develooper Front page | perl.perl5.porters | Postings from August 2016

utf8 mystery in pp_index

Thread Next
Jarkko Hietaniemi
August 16, 2016 23:26
utf8 mystery in pp_index
Message ID:
I had a new Coverity run on blead and it noticed an oddity in 
pp.c:pp_index:3551 or thereabouts:

3550            sv_utf8_upgrade(temp);

     	const: At condition little_utf8, the value of little_utf8 must be 
equal to 0.
     	dead_error_condition: The condition little_utf8 cannot be true.

3551            if (little_utf8) {
CID 152145 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement: big = temp;.

3552                big = temp;

And indeed, the whole "if (little_utf8) {" is in the else branch
of an earlier "if (little_utf8) {" and nothing in the else branch
seems to be capable of modifying the little_utf8 (unlike in the true
branch where bytes_from_utf8() call can modify the little_utf8).

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About