This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert tied SPLICE to using Perl_tied_method()
authorNicholas Clark <nick@ccl4.org>
Wed, 5 Jan 2011 12:39:53 +0000 (12:39 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 5 Jan 2011 12:40:28 +0000 (12:40 +0000)
pp.c

diff --git a/pp.c b/pp.c
index 85614c2..2211291 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -5431,14 +5431,9 @@ PP(pp_splice)
     const MAGIC * const mg = SvTIED_mg((const SV *)ary, PERL_MAGIC_tied);
 
     if (mg) {
-       *MARK-- = SvTIED_obj(MUTABLE_SV(ary), mg);
-       PUSHMARK(MARK);
-       PUTBACK;
-       ENTER_with_name("call_SPLICE");
-       call_method("SPLICE",GIMME_V);
-       LEAVE_with_name("call_SPLICE");
-       SPAGAIN;
-       RETURN;
+       return Perl_tied_method(aTHX_ "SPLICE", mark - 1, MUTABLE_SV(ary), mg,
+                                   GIMME_V | TIED_METHOD_ARGUMENTS_ON_STACK,
+                                   sp - mark);
     }
 
     SP++;