This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
threads::shared: fix leak
authorDavid Mitchell <davem@iabyn.com>
Thu, 11 Jul 2019 14:17:48 +0000 (15:17 +0100)
committerDavid Mitchell <davem@iabyn.com>
Thu, 11 Jul 2019 14:17:48 +0000 (15:17 +0100)
commit59c73bd3d62c5096a6f9b2e3cbe05e1ab4c158cf
treee97b97cf1f8b4a36bac1cf92bbb657b832bc72f8
parent387e2cd4d0d0ac027048044a6c2f046eb1be946f
threads::shared: fix leak

When assigning a shared reference value to a variable containing a
shared string, the PV buffer in the shared space was leaked. For
example:

    my $s :shared = "foo";
    my $t :shared  = shared_clone(\"bar");
    $s = $t; # "foo" in shared space leaked

This was showing up as failed smokes under ASan.
dist/threads-shared/lib/threads/shared.pm
dist/threads-shared/shared.xs