diff options
author | chromatic <chromatic@wgz.org> | 2022-10-27 11:24:58 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-11-01 09:46:16 +0100 |
commit | 1102a6f006f2bb626d2c7f1c5b7d360c28518129 (patch) | |
tree | eb90ea178d14524d853018b788c2c0bc02021d22 /op.c | |
parent | 73d66f354cd4df0324b11e46af48f66bd5c1dd15 (diff) | |
download | perl-1102a6f006f2bb626d2c7f1c5b7d360c28518129.tar.gz |
Enable `use feature 'module_true'`
Per RFC 18, whenever `use feature 'module_true';` is enabled in a scope,
any file required with `require` has an implicit return value of true
and will not trigger the "did not return a true value" error condition.
This includes logic to use the OPf_SPECIAL flag for OP_RETURN listops to
indicate that the module_true feature is in effect when it executes.
This flag plays no role unless the OP_RETURN tail calls the pp_leaveeval
logic, so it doesn't affect normal sub returns.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5225,6 +5225,10 @@ OP * Perl_op_convert_list(pTHX_ I32 type, I32 flags, OP *o) { if (type < 0) type = -type, flags |= OPf_SPECIAL; + if (type == OP_RETURN) { + if (FEATURE_MODULE_TRUE_IS_ENABLED) + flags |= OPf_SPECIAL; + } if (!o || o->op_type != OP_LIST) o = force_list(o, FALSE); else |