Skip to content
Permalink
Browse files

Use new feature flag to allow require return false

  • Loading branch information...
dnmfarrell committed Jul 23, 2018
1 parent 66ee605 commit a003a3f0354ba227835a3c1e29141a354aa13e78
Showing with 4 additions and 1 deletion.
  1. +4 −1 pp_ctl.c
@@ -1622,6 +1622,7 @@ Perl_qerror(pTHX_ SV *err)
* 1: undef $INC{$name}; croak "$name did not return a true value";
* 2: delete $INC{$name}; croak "$errsv: Compilation failed in require"
*/
#include "feature.h"

static void
S_pop_eval_context_maybe_croak(pTHX_ PERL_CONTEXT *cx, SV *errsv, int action)
@@ -1630,7 +1631,9 @@ S_pop_eval_context_maybe_croak(pTHX_ PERL_CONTEXT *cx, SV *errsv, int action)
bool do_croak;

CX_LEAVE_SCOPE(cx);
do_croak = action && (CxOLD_OP_TYPE(cx) == OP_REQUIRE);
do_croak = action && (CxOLD_OP_TYPE(cx) == OP_REQUIRE) &&
(!FEATURE_REQUIRE_FALSE_IS_ENABLED || action == 2);

if (do_croak) {
/* keep namesv alive after cx_popeval() */
namesv = cx->blk_eval.old_namesv;

0 comments on commit a003a3f

Please sign in to comment.
You can’t perform that action at this time.