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*
authorFather Chrysostomos <sprout@cpan.org>
Wed, 15 Oct 2014 04:56:25 +0000 (21:56 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 15 Oct 2014 05:01:46 +0000 (22:01 -0700)
commite791f90a39908c06e138681e3ceb8504cf71c52b
treed31a969a76b139c926a15741e4aff10de5897212
parentf5b5c2a37af8753575a60bff8620560576946b4a
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.)
regen/opcode.pl
regen/opcodes