summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-02-18 19:40:43 +0000
committerNicholas Clark <nick@ccl4.org>2007-02-18 19:40:43 +0000
commitb9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8 (patch)
tree65417bf74a7dc6b1ad198dcf0f64abbe38d16a66 /toke.c
parentbe2b1c742382f74864880924170180bbe1904463 (diff)
downloadperl-b9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8.tar.gz
Add a new API function newSV_type, to replace the idiom:
sv = newSV(0); sv_upgrade(sv, type); p4raw-id: //depot/perl@30347
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index 26f706ebed..7719aa537a 100644
--- a/toke.c
+++ b/toke.c
@@ -924,8 +924,7 @@ S_update_debugger_info(pTHX_ SV *orig_sv, const char *buf, STRLEN len)
{
AV *av = CopFILEAVx(PL_curcop);
if (av) {
- SV * const sv = newSV(0);
- sv_upgrade(sv, SVt_PVMG);
+ SV * const sv = newSV_type(SVt_PVMG);
if (orig_sv)
sv_setsv(sv, orig_sv);
else
@@ -12385,8 +12384,7 @@ Perl_start_subparse(pTHX_ I32 is_format, U32 flags)
save_item(PL_subname);
SAVESPTR(PL_compcv);
- PL_compcv = (CV*)newSV(0);
- sv_upgrade((SV *)PL_compcv, is_format ? SVt_PVFM : SVt_PVCV);
+ PL_compcv = (CV*)newSV_type(is_format ? SVt_PVFM : SVt_PVCV);
CvFLAGS(PL_compcv) |= flags;
PL_subline = CopLINE(PL_curcop);