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

Revert eval in DB fix, changing back to 5.38 CV outside referencing behaviour #22635

Open
wants to merge 3 commits into
base: blead
Choose a base branch
from

Conversation

tonycoz
Copy link
Contributor

@tonycoz tonycoz commented Oct 1, 2024

Reverts 386907f changing CV outside linking to match 5.38.

This is generally suitable for backporting to 5.40, more complex changes (like making outside a weakref) probably aren't.

  • This set of changes requires a perldelta entry, and I need help writing it.

I might add the perldelta later.

This is draft, I plan to add some other TODO tests for the other issues that came up in discussion.

@tonycoz
Copy link
Contributor Author

tonycoz commented Oct 1, 2024

Fixes #22547

@tonycoz tonycoz changed the title 22547 revert db eval Revert eval in DB fix, changing back to 5.38 CV outside referencing behaviour Oct 1, 2024
This reverts commit 386907f.

Reinstates the behaviour of CV outside references from 5.38, fixing Perl#22547

Breaks Perl#19370
and a version with eval EXPR which will remain broken
@tonycoz tonycoz marked this pull request as ready for review November 18, 2024 02:22
@@ -1975,7 +1976,8 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside, HV *cloned,
PL_compcv = cv;
if (newcv) SAVEFREESV(cv); /* in case of fatal warnings */

CvOUTSIDE(cv) = CvREFCNT_inc_simple(outside);
if (CvHASEVAL(cv))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this doesn't backport cleanly into v5.40.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like CvREFCNT_inc_simple isn't a thing in v5.40.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like CvREFCNT_inc_simple isn't a thing in v5.40.0

I added it quite recently. For a backport you can just use regular SvREFCNT_inc and cast its return value

CvOUTSIDE(cv) = (CV *)SvREFCNT_inc(outside);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep it's what I'm doing in my patch. It would be really good to see this backport and there to be a 5.40.1 given we're reverting a behavior that only breaks in 5.40 right now.

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

Successfully merging this pull request may close these issues.

3 participants