From: Nicholas Clark Date: Sat, 8 Apr 2006 14:46:53 +0000 (+0000) Subject: By swapping the order of pushes onto the save stack for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b03d03b0d431a697778042366f63e689b71fbf23;p=p5sagit%2Fp5-mst-13.2.git By swapping the order of pushes onto the save stack for SAVEt_GENERIC_PVREF, we can merge it with SAVEt_PPTR in Perl_ss_dup(). p4raw-id: //depot/perl@27740 --- diff --git a/scope.c b/scope.c index cec853e..be926c8 100644 --- a/scope.c +++ b/scope.c @@ -226,8 +226,8 @@ Perl_save_generic_pvref(pTHX_ char **str) { dVAR; SSCHECK(3); - SSPUSHPTR(str); SSPUSHPTR(*str); + SSPUSHPTR(str); SSPUSHINT(SAVEt_GENERIC_PVREF); } @@ -643,8 +643,8 @@ Perl_leave_scope(pTHX_ I32 base) SvREFCNT_dec(av); break; case SAVEt_GENERIC_PVREF: /* generic pv */ - str = (char*)SSPOPPTR; ptr = SSPOPPTR; + str = (char*)SSPOPPTR; if (*(char**)ptr != str) { Safefree(*(char**)ptr); *(char**)ptr = str; diff --git a/sv.c b/sv.c index 612127f..63cef31 100644 --- a/sv.c +++ b/sv.c @@ -10382,12 +10382,6 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param) gv = (GV*)POPPTR(ss,ix); TOPPTR(nss,ix) = gv_dup_inc(gv, param); break; - case SAVEt_GENERIC_PVREF: /* generic char* */ - c = (char*)POPPTR(ss,ix); - TOPPTR(nss,ix) = pv_dup(c); - ptr = POPPTR(ss,ix); - TOPPTR(nss,ix) = any_dup(ptr, proto_perl); - break; case SAVEt_SHARED_PVREF: /* char* in shared space */ c = (char*)POPPTR(ss,ix); TOPPTR(nss,ix) = savesharedpv(c); @@ -10452,6 +10446,7 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param) ptr = POPPTR(ss,ix); TOPPTR(nss,ix) = any_dup(ptr, proto_perl); break; + case SAVEt_GENERIC_PVREF: /* generic char* */ case SAVEt_PPTR: /* char* reference */ ptr = POPPTR(ss,ix); TOPPTR(nss,ix) = any_dup(ptr, proto_perl);