diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2023-02-08 18:14:14 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2023-02-10 14:38:44 +0000 |
commit | 054ceeebc7f6acad2772faa4fa88617c35f4a88a (patch) | |
tree | af2d9c0d75e3f10ee26f575e7dab8973e757dd83 /lib | |
parent | e3b003dd8ca8d881450f6c96297ffa35f6a92ed1 (diff) | |
download | perl-054ceeebc7f6acad2772faa4fa88617c35f4a88a.tar.gz |
Accept field VAR = EXPR on field vars
Allows non-constant expressions with side effects. Evaluated during the
constructor of each instance.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/B/Op_private.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/B/Op_private.pm b/lib/B/Op_private.pm index 8d20e0278c..bb1a07296f 100644 --- a/lib/B/Op_private.pm +++ b/lib/B/Op_private.pm @@ -404,6 +404,7 @@ $bits{i_predec}{0} = $bf[0]; $bits{i_preinc}{0} = $bf[0]; @{$bits{i_subtract}}{1,0} = ($bf[1], $bf[1]); @{$bits{index}}{3,2,1,0} = ($bf[4], $bf[4], $bf[4], $bf[4]); +@{$bits{initfield}}{2,1,0} = ('OPpINITFIELD_HV', 'OPpINITFIELD_AV', $bf[0]); $bits{int}{0} = $bf[0]; @{$bits{ioctl}}{3,2,1,0} = ($bf[4], $bf[4], $bf[4], $bf[4]); $bits{is_bool}{0} = $bf[0]; @@ -649,6 +650,8 @@ our %defines = ( OPpHINT_STRICT_REFS => 2, OPpHUSH_VMSISH => 32, OPpINDEX_BOOLNEG => 64, + OPpINITFIELD_AV => 2, + OPpINITFIELD_HV => 4, OPpITER_DEF => 8, OPpITER_REVERSED => 2, OPpKVSLICE => 32, @@ -760,6 +763,8 @@ our %labels = ( OPpHINT_STRICT_REFS => 'STRICT', OPpHUSH_VMSISH => 'HUSH', OPpINDEX_BOOLNEG => 'NEG', + OPpINITFIELD_AV => 'INITFIELD_AV', + OPpINITFIELD_HV => 'INITFIELD_HV', OPpITER_DEF => 'DEF', OPpITER_REVERSED => 'REVERSED', OPpKVSLICE => 'KVSLICE', @@ -842,6 +847,7 @@ our %ops_using = ( OPpHINT_STRICT_REFS => [qw(entersub multideref rv2av rv2cv rv2gv rv2hv rv2sv)], OPpHUSH_VMSISH => [qw(dbstate nextstate)], OPpINDEX_BOOLNEG => [qw(index rindex)], + OPpINITFIELD_AV => [qw(initfield)], OPpITER_DEF => [qw(enteriter)], OPpITER_REVERSED => [qw(enteriter iter)], OPpKVSLICE => [qw(delete)], @@ -896,6 +902,7 @@ $ops_using{OPpEVAL_RE_REPARSING} = $ops_using{OPpEVAL_BYTES}; $ops_using{OPpEVAL_UNICODE} = $ops_using{OPpEVAL_BYTES}; $ops_using{OPpFT_STACKED} = $ops_using{OPpFT_AFTER_t}; $ops_using{OPpFT_STACKING} = $ops_using{OPpFT_AFTER_t}; +$ops_using{OPpINITFIELD_HV} = $ops_using{OPpINITFIELD_AV}; $ops_using{OPpLVREF_ITER} = $ops_using{OPpLVREF_ELEM}; $ops_using{OPpMAY_RETURN_CONSTANT} = $ops_using{OPpENTERSUB_NOPAREN}; $ops_using{OPpMULTICONCAT_FAKE} = $ops_using{OPpMULTICONCAT_APPEND}; |