Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modification of non-creatable array value attempted #73

Open
vytas-dauksa opened this issue Nov 24, 2014 · 1 comment
Open

Modification of non-creatable array value attempted #73

vytas-dauksa opened this issue Nov 24, 2014 · 1 comment

Comments

@vytas-dauksa
Copy link

Perl::Lint errors out on following code:
local $SIG{ALRM} = sub { die "Timeout"; };
if (1) { die "Blaa"; }

vytas@tor:/tmp$ perlbrew exec perl -MCarp::Always c.pl

perl-5.20.1

Modification of non-creatable array value attempted, subscript -1 at /home/vytas/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Perl/Lint/Policy/InputOutput/RequireBriefOpen.pm line 196, <$fh> line 1.
Perl::Lint::Policy::InputOutput::RequireBriefOpen::evaluate("Perl::Lint::Policy::InputOutput::RequireBriefOpen", "u.pl", ARRAY(0x1bfd588), "local $SIG{ALRM} = sub { die "Timeout"; };\x{a}\x{a}if (1) { die "Bla"..., HASH(0x1853148)) called at /home/vytas/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Perl/Lint.pm line 91
Perl::Lint::_lint(Perl::Lint=HASH(0x27f0f50), "local $SIG{ALRM} = sub { die "Timeout"; };\x{a}\x{a}if (1) { die "Bla"..., "u.pl") called at /home/vytas/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Perl/Lint.pm line 70
Perl::Lint::lint(Perl::Lint=HASH(0x27f0f50), ARRAY(0x27e7b28)) called at c.pl line 11

Running latest Perl::Lint version ( 0.10 ).

mephinet added a commit to mephinet/Perl-Lint that referenced this issue Dec 28, 2014
@mephinet
Copy link

I also ran into this bug for a file that uses OX' syntactic sugar "as". The testcase added in dc8689f reproduces the issue. When stepping through the code of Perl::Lint::Policy::InputOutput::RequireBriefOpen, I can see that it calls push @opened_file_handlers_for_each_depth once, but pop @opened_file_handlers_for_each_depth twice - so the cause seems to be that %function_declared_depth gets confused...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants