diff options
author | Tony Cook <tony@develop-help.com> | 2011-11-14 19:30:17 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2011-11-14 19:30:17 +1100 |
commit | 28884311ae0933070ec776bd972da9d711a5184b (patch) | |
tree | 52a185013e289ab75457e4ddd21974f0cd9cf88d /universal.c | |
parent | aeba7c97cf81cc1734fe47cebfeef2fa5e3d696f (diff) | |
download | perl-28884311ae0933070ec776bd972da9d711a5184b.tar.gz |
[rt #103222] make Internals::SvREFCNT set/get consistent
Diffstat (limited to 'universal.c')
-rw-r--r-- | universal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/universal.c b/universal.c index d623a67ed3..0599e6795d 100644 --- a/universal.c +++ b/universal.c @@ -927,8 +927,8 @@ XS(XS_Internals_SvREFCNT) /* This is dangerous stuff. */ XSRETURN_IV(SvREFCNT(sv) - 1); /* Minus the ref created for us. */ else if (items == 2) { /* I hope you really know what you are doing. */ - SvREFCNT(sv) = SvIV(ST(1)); - XSRETURN_IV(SvREFCNT(sv)); + SvREFCNT(sv) = SvIV(ST(1)) + 1; /* we free one ref on exit */ + XSRETURN_IV(SvREFCNT(sv) - 1); } XSRETURN_UNDEF; /* Can't happen. */ } |