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

[perl #121738] [PATCH] Coverity: regcomp.c: bit-or used when bit-and meant

Thread Next
From:
Tony Cook via RT
Date:
April 27, 2014 23:43
Subject:
[perl #121738] [PATCH] Coverity: regcomp.c: bit-or used when bit-and meant
Message ID:
rt-4.0.18-8055-1398642209-1043.121738-15-0@perl.org
On Sat Apr 26 09:41:48 2014, jhi wrote:
> regcomp.c:14693-ish:
> 
> operator_confusion: ret->flags | 0x10 is always 1/true regardless of
> the values of its operand. This occurs as the logical first operand of 
> '&&'. Did you intend to use '&' rather than '|'?
> 
> -        && ! ((ANYOF_FLAGS(ret) | ANYOF_WARN_SUPER) && ALWAYS_WARN_SUPER))
> +        && ! ((ANYOF_FLAGS(ret) & ANYOF_WARN_SUPER) && ALWAYS_WARN_SUPER))
> 
> (confirmed by Karl Williamson)
> 
> Attached.

This appears (to me) to be a lost optimization opportunity rather than a critical bug.

Added as a 5.21.1 blocker so it will be applied after 5.20 is released.

Tony



---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=121738

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