diff options
author | Gerard Goossen <gerard@ggoossen.net> | 2009-11-16 13:58:24 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-11-21 19:26:51 +0100 |
commit | 021f53de09926928546378b3552f9240c9241dde (patch) | |
tree | a3ba92293e96921c4787a19f8b95b0f75af94303 /op.c | |
parent | 5255f1f44de85b78264e59ed3da05d4a6d3f3671 (diff) | |
download | perl-021f53de09926928546378b3552f9240c9241dde.tar.gz |
Force OP_REQUIRE to scalar context at the end of ck_require and don't let it become void context. Fixes problem with require not always being in scalar context.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -985,7 +985,7 @@ Perl_scalarvoid(pTHX_ OP *o) want = o->op_flags & OPf_WANT; if ((want && want != OPf_WANT_SCALAR) || (PL_parser && PL_parser->error_count) - || o->op_type == OP_RETURN) + || o->op_type == OP_RETURN || o->op_type == OP_REQUIRE) { return o; } @@ -1215,10 +1215,6 @@ Perl_scalarvoid(pTHX_ OP *o) case OP_ENTEREVAL: scalarkids(o); break; - case OP_REQUIRE: - /* all requires must return a boolean value */ - o->op_flags &= ~OPf_WANT; - /* FALL THROUGH */ case OP_SCALAR: return scalar(o); } @@ -1307,10 +1303,6 @@ Perl_list(pTHX_ OP *o) } PL_curcop = &PL_compiling; break; - case OP_REQUIRE: - /* all requires must return a boolean value */ - o->op_flags &= ~OPf_WANT; - return scalar(o); } return o; } @@ -7677,7 +7669,7 @@ Perl_ck_require(pTHX_ OP *o) return newop; } - return ck_fun(o); + return scalar(ck_fun(o)); } OP * |