This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_gimme_V(): assume caller always provides cxt
authorDavid Mitchell <davem@iabyn.com>
Wed, 18 Sep 2019 12:43:12 +0000 (13:43 +0100)
committerDavid Mitchell <davem@iabyn.com>
Thu, 19 Sep 2019 07:42:46 +0000 (08:42 +0100)
So we don't need to check whether (cxstack[cxix].blk_gimme & G_WANT),
just use it. Replace the check with an assertion.

inline.h

index 1755893..f52d4e5 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -2069,11 +2069,8 @@ Perl_gimme_V(pTHX)
     cxix = PL_curstackinfo->si_cxsubix;
     if (cxix < 0)
         return G_VOID;
-    gimme = (cxstack[cxix].blk_gimme & G_WANT);
-    if (gimme)
-        return gimme;
-    /* use the full sub to report the error */
-    return block_gimme();
+    assert(cxstack[cxix].blk_gimme & G_WANT);
+    return (cxstack[cxix].blk_gimme & G_WANT);
 }