‘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.)
'T' => 8 | 16, # ... which may be lexical
'i' => 0, # always produces integer (unused since e7311069)
'I' => 32, # has corresponding int op
- 'd' => 64, # danger, unknown side effects
+ 'd' => 64, # danger, make temp copy in list assignment
'u' => 128, # defaults to $_
);
# needs a target - t (OA_TARGET)
# target can be in a pad - T (OA_TARGET|OA_TARGLEX)
# has a corresponding integer version - I (OA_OTHERINT)
-# has side effects - d (OA_DANGEROUS)
+# make temp copy in list assignment - d (OA_DANGEROUS)
# uses $_ if no argument given - u (OA_DEFGV)
# Values for the operands are: