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

Deparsing of try/catch cannot handle ENTER/LEAVE wrapped catch #18874

Closed
wolfsage opened this issue Jun 10, 2021 · 1 comment
Closed

Deparsing of try/catch cannot handle ENTER/LEAVE wrapped catch #18874

wolfsage opened this issue Jun 10, 2021 · 1 comment

Comments

@wolfsage
Copy link
Contributor

B::Deparse does not know how to handle catch{} if it has a full ENTER/LEAVE scope.

This works:

$ ./perl -Ilib -MO=Deparse -e 'use feature qw(try); sub foo { try { 1; } catch ($e) { $e; } }'
try/catch is experimental at -e line 1.
try/catch is experimental at -e line 1.
use feature 'try';
sub foo {
    try {
        1;
    }
    catch($e) {
        $e;
    }
}
-e syntax OK

This doesn't:

$ ./perl -Ilib -MO=Deparse -e 'use feature qw(try); sub foo { try { 1; } catch ($e) { my $x; $e; } }'
try/catch is experimental at -e line 1.
try/catch is experimental at -e line 1.
While deparsing -e near line 1,
Expected scope as second child of catch at lib/B/Deparse.pm line 4075.
CHECK failed--call queue aborted.

@wolfsage
Copy link
Contributor Author

Fix merged.

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

Successfully merging a pull request may close this issue.

1 participant