Created
February 2, 2016 19:54
-
-
Save arodland/be002c0abb6e4048eec9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ListUtil.xs b/ListUtil.xs | |
index a7cd20c..daa0c41 100644 | |
--- a/ListUtil.xs | |
+++ b/ListUtil.xs | |
@@ -384,7 +384,9 @@ CODE: | |
for(index = 1 ; index < items ; index++) { | |
GvSV(PL_defgv) = args[index]; | |
+ SvREFCNT_inc(args[index]); | |
MULTICALL; | |
+ SvREFCNT_dec(args[index]); | |
if(SvTRUEx(*PL_stack_sp)) { | |
# ifdef PERL_HAS_BAD_MULTICALL_REFCOUNT | |
if(CvDEPTH(multicall_cv) > 1) | |
@@ -409,7 +411,9 @@ CODE: | |
GvSV(PL_defgv) = args[index]; | |
PUSHMARK(SP); | |
+ SvREFCNT_inc(args[index]); | |
call_sv((SV*)cv, G_SCALAR); | |
+ SvREFCNT_dec(args[index]); | |
if(SvTRUEx(*PL_stack_sp)) { | |
ST(0) = ST(index); | |
XSRETURN(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment