-
Notifications
You must be signed in to change notification settings - Fork 559
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
eval_sv() doesn't preserve caller hints/features #21415
Comments
Nice find 👍🏻, I wander if that'd be the same with
I think this example should have
The warnings example (of |
tonycoz
added a commit
to tonycoz/perl5
that referenced
this issue
Aug 23, 2023
Fixes Perl#21415 WIP, needs docs
tonycoz
added a commit
to tonycoz/perl5
that referenced
this issue
Aug 24, 2023
tonycoz
added a commit
to tonycoz/perl5
that referenced
this issue
Aug 28, 2023
tonycoz
added a commit
to tonycoz/perl5
that referenced
this issue
Aug 29, 2023
tonycoz
added a commit
that referenced
this issue
Aug 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Perl API function
eval_sv()
is conceptually the XS version of the Perleval()
function. But it doesn't really match very well, because it doesn't preserve the hints bits or enabled features of its caller; whereas the Perl function does.eval_sv()
isn't normally accessible from Perl but we can abuseXS::APItest
in a built source checkout to find a callable copy of it. See the following examples.The hints bits include the
strict
flags; these are not preserved:The features bits include the enabled keywords; these are not preserved either:
By comparison, the warnings bits are preserved, suggesting that at least this general testing method is valid:
Ultimately, I don't think this behaviour could be changed by default without breaking a huge amount of existing code. However, I think it would be useful to provide a new flag of some name I don't have a good suggestion for, to ask it to do this.
The text was updated successfully, but these errors were encountered: