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

compile-time re-eval count is not saved correctly #75

Open
atoomic opened this issue Aug 30, 2017 · 1 comment
Open

compile-time re-eval count is not saved correctly #75

atoomic opened this issue Aug 30, 2017 · 1 comment

Comments

@atoomic
Copy link
Collaborator

atoomic commented Aug 30, 2017

This is an extract from t/split.t in the perl 5.26.0 test suite. ( the test can also be run under perl 5.24 )

When using 'our', the compiled version provides the same behavior as the uncompiled one.
With 'my' the value is incorrect once compiled

# uncompiled
> perl524 -e 'our $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
2
> perl524 -e 'my $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
2
# compiled
> perlcc -r -e 'our $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
2
> perlcc -r -e 'my $c = 0; @a = split /-(?{ $c++ })/, "a-b-c"; print qq[$c\n];'
0
@atoomic
Copy link
Collaborator Author

atoomic commented Aug 30, 2017

I suspect one of the CvOutside is not set correctly

> perl -e 'my $c = 0; my $xy = $ENV{AAA} ? undef : "a-b-c"; @a = split /-(?{ $c++ })/, $xy; print qq[$c\n];'
2
> perlcc -r -e 'my $c = 0; my $xy = $ENV{AAA} ? undef : "a-b-c"; @a = split /-(?{ $c++ })/, $xy; print qq[$c\n];'
0

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

No branches or pull requests

1 participant