Skip to content

5.41.4: B::Deparse generates code which emits "Possible precedence problem between ! and numeric eq (==)" warning #22661

@eserte

Description

@eserte

Module: B::Deparse

Description
!$something == $else throws warnings with perl 5.41.x. B::Deparse may generate code which triggers this warning.

Steps to Reproduce
Sample oneliner:

$ perl5.41.4 -w -MO=Deparse -e 'my $p; if ((!$p) == 1) { }' | perl5.41.4 -cw
-e syntax OK
Possible precedence problem between ! and numeric eq (==) at - line 3.
- syntax OK

Output produced by B::Deparse is here:

BEGIN { $^W = 1; }
my $p;
if (!$p == 1) {
    ();
}
-e syntax OK

Expected behavior
B::Deparse should not drop the parentheses in this example

Perl configuration

Seen with normally compiled 5.41.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions