From: Nicholas Clark Date: Sun, 31 Oct 2010 08:16:54 +0000 (+0000) Subject: Merge the implementation of B::CV::{XSUB,XSUBANY} using ALIAS. X-Git-Tag: upstream/5.16.3~7062 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96819e59c084b0c40c5f588feece3d858b9cc98e;p=platform%2Fupstream%2Fperl.git Merge the implementation of B::CV::{XSUB,XSUBANY} using ALIAS. --- diff --git a/ext/B/B.xs b/ext/B/B.xs index 96d9dc5012..4ecf1d9a0c 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1960,17 +1960,15 @@ CvSTART(cv) void CvXSUB(cv) B::CV cv + ALIAS: + XSUBANY = 1 CODE: - ST(0) = sv_2mortal(newSViv(CvISXSUB(cv) ? PTR2IV(CvXSUB(cv)) : 0)); - - -void -CvXSUBANY(cv) - B::CV cv - CODE: - ST(0) = CvCONST(cv) + ST(0) = ix && CvCONST(cv) ? make_sv_object(aTHX_ NULL, (SV *)CvXSUBANY(cv).any_ptr) - : sv_2mortal(newSViv(CvISXSUB(cv) ? CvXSUBANY(cv).any_iv : 0)); + : sv_2mortal(newSViv(CvISXSUB(cv) + ? (ix ? CvXSUBANY(cv).any_iv + : PTR2IV(CvXSUB(cv))) + : 0)); MODULE = B PACKAGE = B::CV PREFIX = cv_ @@ -1978,7 +1976,6 @@ B::SV cv_const_sv(cv) B::CV cv - MODULE = B PACKAGE = B::HV PREFIX = Hv STRLEN