This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Replace the macro RETURNX() with its expansion in FT_RETURN_{FALSE,TRUE}
authorNicholas Clark <nick@ccl4.org>
Fri, 27 Jul 2012 10:54:49 +0000 (12:54 +0200)
committerNicholas Clark <nick@ccl4.org>
Sat, 28 Jul 2012 07:56:58 +0000 (09:56 +0200)
The macros FT_RETURN_FALSE and FT_RETURN_TRUE in pp_ctl.c are already very
complex, sufficient to trigger an internal failure in HP's compiler [and
possibly also some humans :-)]. Replacing RETURNX() with the 3 statements it
expands to makes the intent of macros clearer, and exposes more refactoring
possibilities.

pp_sys.c

index 549256b..3368d5f 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2925,16 +2925,22 @@ S_ft_stacking_return_false(pTHX_ SV *ret) {
     STMT_START {                                     \
        if (PL_op->op_private & OPpFT_STACKING)        \
            return S_ft_stacking_return_false(aTHX_ X); \
-       RETURNX(PL_op->op_flags & OPf_REF ? XPUSHs(X) : SETs(X)); \
+       PL_op->op_flags & OPf_REF ? XPUSHs(X) : SETs(X); \
+        PUTBACK;                                          \
+        return NORMAL;                                     \
     } STMT_END
-#define FT_RETURN_TRUE(X)               \
-    RETURNX((void)(                      \
-       PL_op->op_flags & OPf_REF          \
-           ? (bool)XPUSHs(                 \
+#define FT_RETURN_TRUE(X)                                               \
+    STMT_START {                                                        \
+        (void)(                                                         \
+            PL_op->op_flags & OPf_REF                                   \
+           ? (bool)XPUSHs(                                             \
                PL_op->op_private & OPpFT_STACKING ? (SV *)cGVOP_gv : (X) \
-             )                                                           \
-           : (PL_op->op_private & OPpFT_STACKING || SETs(X))             \
-    ))
+                )                                                       \
+           : (PL_op->op_private & OPpFT_STACKING || SETs(X))           \
+            );                                                          \
+        PUTBACK;                                                        \
+        return NORMAL;                                                  \
+    } STMT_END
 
 #define FT_RETURNNO    FT_RETURN_FALSE(&PL_sv_no)
 #define FT_RETURNUNDEF FT_RETURN_FALSE(&PL_sv_undef)