summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-09-26 12:56:47 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:08 -0700
commita15456ded8f3d1fb2d67e9e3027b5766cc1c419f (patch)
tree86c9ca52d9348bc2218b1fee299d2ca74ba3892c /pp.c
parent70b71ec84c6ce44565d910f531ad659af12a4c35 (diff)
downloadperl-a15456ded8f3d1fb2d67e9e3027b5766cc1c419f.tar.gz
pp.c & sv.c: pp_ref UTF8 and null cleanup.
This adds a new function to sv.c, sv_ref, which is a nul-and-UTF8 clean version of sv_reftype. pp_ref now uses that. sv_ref() not only returns the SV, but also takes in an SV to modify, so we can say both sv_ref(TARG, obj, TRUE); and sv = sv_ref(NULL, obj, TRUE);
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index 316b80ea94..9250751644 100644
--- a/pp.c
+++ b/pp.c
@@ -537,7 +537,6 @@ S_refto(pTHX_ SV *sv)
PP(pp_ref)
{
dVAR; dSP; dTARGET;
- const char *pv;
SV * const sv = POPs;
if (sv)
@@ -546,8 +545,8 @@ PP(pp_ref)
if (!sv || !SvROK(sv))
RETPUSHNO;
- pv = sv_reftype(SvRV(sv),TRUE);
- PUSHp(pv, strlen(pv));
+ (void)sv_ref(TARG,SvRV(sv),TRUE);
+ PUSHTARG;
RETURN;
}