SIP Precedence Warning, possible logic issue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
EG 2.8.4
Perl 5.20.2
I've got a bunch of warnings in my sip logs that say
Possible precedence issue with control flow operator at /usr/local/
The code looks like the following:
312 return
313 !$circ_is_blocked and
314 $u->active eq 't' and
315 $u->card->active eq 't';
316 }
I believe that is being interpreted as
(return !$circ_is_blocked) and $u->active eq 't' and $u->card->active eq 't';
So the only check that actually matters is the !circ_is_blocked, the active check and card active check are never reached.
The warning is described at
http://
"not", "and", "or" are considered low precedence operators in perl.
So the solution is to either use a high precedence 'and' (&&) or use parentheses around the checks. But I would like a second opinion.
Josh
Changed in evergreen: | |
status: | New → Confirmed |
Changed in evergreen: | |
assignee: | nobody → Josh Stompro (u-launchpad-stompro-org) |
Changed in evergreen: | |
assignee: | Josh Stompro (u-launchpad-stompro-org) → Jeff Godin (jgodin) |
tags: | added: sip |
Changed in evergreen: | |
assignee: | Jeff Godin (jgodin) → Jason Stephenson (jstephenson) |
milestone: | none → 3.3-rc |
I confirm that there is indeed a precedence bug.