This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change OA_DANGEROUS description in regen/opcode*
‘Has side effects’ can be misleading. The OA_DANGEROUS flag is only
used by the common-vars search that checks to see whether it is possi-
ble to skip making temporary copies.
We have to make copies in cases like this:
($a,$b) = func();
because func() could return ($b,$a).
If any op on either side is marked OA_DANGEROUS and not handled spe-
cially in op.c:S_aassign_scommon_vars, then it is assumed it could
return a scalar that is also elsewhere in the list, so a temp copy
is needed.
(I think some of the existing ops with this flag could drop it.)