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

fix refassign in non-void context #22938

Merged
merged 1 commit into from
Jan 22, 2025
Merged

fix refassign in non-void context #22938

merged 1 commit into from
Jan 22, 2025

Conversation

iabyn
Copy link
Contributor

@iabyn iabyn commented Jan 20, 2025

GH #22710

The experimental refassign feature, @A = $aref, which allows an array/hash etc to be aliased rather than copied, got broken in rvalue non-void context by v5.39.5-56-g604c0355d2. So in something like

my $x = (\@a = $aref);

the stack was underflowing. This is because previously pp_refassign() would leave its RH argument on the stack when returning, while my commit above made it always pop the argument off the stack.

This commit makes it only pop the arg in void context.

  • This set of changes requires a perldelta entry, but is not written yet

GH #22710

The experimental refassign feature, \@A = $aref, which allows an
array/hash etc to be aliased rather than copied, got broken in rvalue
non-void context by v5.39.5-56-g604c0355d2. So in something like

    my $x = (\@A = $aref);

the stack was underflowing. This is because previously pp_refassign()
would leave its RH argument on the stack when returning, while my commit
above made it always pop the argument off the stack.

This commit makes it only pop the arg in void context.
@iabyn iabyn merged commit 53119a6 into blead Jan 22, 2025
68 checks passed
@iabyn iabyn deleted the davem/gh22710 branch January 22, 2025 12:34
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.

2 participants