nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

FORM refcnt++ analog to CV because of glob_assign_glob #294

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
CVs on 5.10 are always refcnt+1 because they cannot be deleted properly.

esp. for the body in sv_clear:
    else if (sv_type_details->body_size) {
        safefree(SvANY(sv));

we need the same for GP->FORM fields
in the case of glob_assign_glob() which does gp_free.

testcase: t/CORE/op/gv.t:171 *x = *STDOUT;

Original issue reported on code.google.com by reini.urban on 7 Feb 2014 at 10:57

GoogleCodeExporter commented 9 years ago
Fixed with commit 53291d1783a7dc8672218015364f39419e924d36
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Feb 7 16:58:37 2014 -0600

    C: incr CV and GP->FORM refcounts against glob_assign_glob

    CVs on 5.10 are always refcnt+1 because they cannot be deleted properly.
    esp. for the body in sv_clear:
    else if (sv_type_details->body_size) {
        safefree(SvANY(sv));

    we need the same for GP->FORM fields
    in the case of glob_assign_glob() which does gp_free.

    testcase: t/CORE/op/gv.t:171 *x = *STDOUT;
    fixes #294

Original comment by reini.urban on 7 Feb 2014 at 11:17