This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Reorder S_ft_stacking_return_false().
authorNicholas Clark <nick@ccl4.org>
Fri, 27 Jul 2012 11:32:33 +0000 (13:32 +0200)
committerNicholas Clark <nick@ccl4.org>
Sat, 28 Jul 2012 07:56:58 +0000 (09:56 +0200)
Move the code which deals with setting the return value on perl's stack
ahead of the code which calculates which op to run next (the return value of
the C function).

pp_sys.c

index 799ead3..891a76d 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2910,14 +2910,16 @@ PP(pp_stat)
 
 static OP *
 S_ft_stacking_return_false(pTHX_ SV *ret) {
-    dSP;
     OP *next = NORMAL;
-    while (OP_IS_FILETEST(next->op_type)
-       && next->op_private & OPpFT_STACKED)
-       next = next->op_next;
+    dSP;
+
     if (PL_op->op_flags & OPf_REF) XPUSHs(ret);
     else                          SETs(ret);
     PUTBACK;
+
+    while (OP_IS_FILETEST(next->op_type)
+       && next->op_private & OPpFT_STACKED)
+       next = next->op_next;
     return next;
 }