diff options
author | Tony Cook <tony@develop-help.com> | 2011-11-14 19:48:54 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2011-11-14 19:48:54 +1100 |
commit | 691f175822a5edda9dc7ba243d6c774254b9e225 (patch) | |
tree | 5415039182fd455755d9e457f2da539bc6be36d7 /universal.c | |
parent | 28884311ae0933070ec776bd972da9d711a5184b (diff) | |
download | perl-691f175822a5edda9dc7ba243d6c774254b9e225.tar.gz |
Internals::SvREFCNT() now treats reference counts as unsigned
Previously setting a large (negative in 32-bit signed) reference count
would be returned as a positive number on 64-bit builds and negative
on 32-bit builds.
Diffstat (limited to 'universal.c')
-rw-r--r-- | universal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/universal.c b/universal.c index 0599e6795d..6ea0e29cb1 100644 --- a/universal.c +++ b/universal.c @@ -924,11 +924,11 @@ XS(XS_Internals_SvREFCNT) /* This is dangerous stuff. */ sv = SvRV(svz); if (items == 1) - XSRETURN_IV(SvREFCNT(sv) - 1); /* Minus the ref created for us. */ + XSRETURN_UV(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)) + 1; /* we free one ref on exit */ - XSRETURN_IV(SvREFCNT(sv) - 1); + SvREFCNT(sv) = SvUV(ST(1)) + 1; /* we free one ref on exit */ + XSRETURN_UV(SvREFCNT(sv) - 1); } XSRETURN_UNDEF; /* Can't happen. */ } |