develooper Front page | perl.perl5.porters | Postings from December 2013

Re: [perl #120128] [PATCH] Optimise if(a || b) and unless(a && b)

Thread Previous | Thread Next
From:
demerphq
Date:
December 13, 2013 13:45
Subject:
Re: [perl #120128] [PATCH] Optimise if(a || b) and unless(a && b)
Message ID:
CANgJU+XKFnVKD1LjC2-cntqML8wLgC339dmkjiCk_KUku5GVfg@mail.gmail.com
On 8 October 2013 22:05, Matthew Horsfall <perlbug-followup@perl.org> wrote:
> # New Ticket Created by  Matthew Horsfall
> # Please include the string:  [perl #120128]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=120128 >
>
>
> This is a bug report for perl from WolfSage@gmail.com,
> generated with the help of perlbug 1.39 running under perl 5.10.1.
>
>
> -----------------------------------------------------------------
> [Please describe your issue here]
>
> I've squashed the two prevous commits related to OP_AND/OP_OR/OP_DOR
> optimisations and attached it here, and removed the OP_OR/OP_DOR chaining
> since it was dead wrong.
>
> It broke this case:
>
>   $b = 0;
>
>   $x = $b // $c || 'cat';
>
> (It caused $x to be 0 instead of 'cat').

Wow. That that results in "cat" is quite surprising to me. Isn't that
a precedence bug?

Yves

Thread Previous | 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