diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-12-03 10:30:06 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-12-03 12:42:08 -0800 |
commit | 83a94553cbf9f2c11b3e9a63a44e7b9ce17ccb77 (patch) | |
tree | b6649263a89bc864ac9ec4c620bde35c934d3cc2 /ext/XS-APItest | |
parent | e5860534bf7ec7cb8c8e4b6211178d1d1369e13d (diff) | |
download | perl-83a94553cbf9f2c11b3e9a63a44e7b9ce17ccb77.tar.gz |
[perl #40565] Fix localisation in pseudo-fork
Several SAVEt_* types were giving the SVs the wrong reference counts
in ss_dup, causing child process to lose SVs too soon.
See <https://rt.perl.org/Ticket/Display.html?id=40565#txn-1180404>
and <https://rt.perl.org/Ticket/Display.html?id=40565#txn-1277127>.
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r-- | ext/XS-APItest/t/clone-with-stack.t | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/ext/XS-APItest/t/clone-with-stack.t b/ext/XS-APItest/t/clone-with-stack.t index 3f68c93377..179fba04a9 100644 --- a/ext/XS-APItest/t/clone-with-stack.t +++ b/ext/XS-APItest/t/clone-with-stack.t @@ -17,7 +17,7 @@ if (not $Config{'useithreads'}) { skip_all("clone_with_stack requires threads"); } -plan(5); +plan(6); fresh_perl_is( <<'----', <<'====', undef, "minimal clone_with_stack" ); use XS::APItest; @@ -78,3 +78,26 @@ f(); ==== } + +{ + fresh_perl_is( <<'----', <<'====', undef, "with localised stuff" ); +use XS::APItest; +$s = "outer"; +$a[0] = "anterior"; +$h{k} = "hale"; +{ + local $s = "inner"; + local $a[0] = 'posterior'; + local $h{k} = "halt"; + clone_with_stack(); +} +print "scl: $s\n"; +print "ary: $a[0]\n"; +print "hsh: $h{k}\n"; +---- +scl: outer +ary: anterior +hsh: hale +==== + +} |