summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2023-05-01 14:48:41 +1000
committerPaul Evans <leonerd@leonerd.org.uk>2023-05-12 16:23:26 +0100
commit1cb47656bd2455cb88e83248911ba4138ccd4e7a (patch)
treead8d12ef3cf5450185b3c043fafff1bb7398e93b
parent5462b17e4274b0f16b62d347717697c9e6ee193c (diff)
downloadperl-1cb47656bd2455cb88e83248911ba4138ccd4e7a.tar.gz
Revert "Perl_leave_adjust_stacks: don't make mortal copies of SvIMMORTAL SVs"
This reverts commit c56d7fa9134de66efe85a2fd70b28069c2629e0d. Also un-TODO's the new test for this issue. Fixes #21044
-rw-r--r--pp_hot.c7
-rw-r--r--t/op/sub.t3
2 files changed, 0 insertions, 10 deletions
diff --git a/pp_hot.c b/pp_hot.c
index d9b4d6e6fb..3ec24a0e23 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -5085,13 +5085,6 @@ Perl_leave_adjust_stacks(pTHX_ SV **from_sp, SV **to_sp, U8 gimme, int pass)
}
}
}
- else if (SvIMMORTAL(sv)){
- /* Since SvIMMORTALs are never freed, even when their
- * refcount drops to zero, there's no benefit in
- * creating a mortal copy.
- */
- *++to_sp = sv;
- }
else {
/* Make a mortal copy of the SV.
* The following code is the equivalent of sv_mortalcopy()
diff --git a/t/op/sub.t b/t/op/sub.t
index 0eae1d50de..e703880ec8 100644
--- a/t/op/sub.t
+++ b/t/op/sub.t
@@ -445,8 +445,5 @@ fresh_perl_like(
);
# github #21044
-{
- local $TODO = "sub return values not modifiable";
ok( eval { $_->{x} = 1 for sub { undef }->(); 1 }, "check sub return values are modifiable")
or diag $@;
-}