diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-11-08 12:54:37 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-11-08 16:06:43 -0800 |
commit | 6575cde09f3b8f22b60ff3c736fc7fba3ee0ef00 (patch) | |
tree | 0f5351120eec8a31f034e9527db948e48b9a35e8 /opcode.h | |
parent | 26812b4a900f5f8ec634ef9bb566822cb2b43975 (diff) | |
download | perl-6575cde09f3b8f22b60ff3c736fc7fba3ee0ef00.tar.gz |
tied is OA_DANGEROUS
OA_DANGEROUS indicates that temporary copies may need to be made in
list assignment, to handle things like:
($a, $b) = ($b, $a);
In other words, an op type is flagged with OA_DANGEROUS if its return
values could occur elsewhere on the stack.
tied returns the same scalar that the tied variables uses to hold a
reference to the object (so weaken(tied(...)) works). tie uses the
very scalar that TIESCALAR (or TIEWHATEVER) returns and attaches it to
the tied variable by magic. That returned scalar could be referenced
elsewhere. That means
($a, $b) = ($c, tied $d)
could have common vars on either side, if the tie constructor for $d
happened to return $a or $b. (Normally it would have to be an XSUB or
an lvalue sub for its return value not to have been copied.)
Diffstat (limited to 'opcode.h')
-rw-r--r-- | opcode.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1956,7 +1956,7 @@ EXTCONST U32 PL_opargs[] = { 0x00096404, /* binmode */ 0x00217445, /* tie */ 0x00007b04, /* untie */ - 0x00007b04, /* tied */ + 0x00007b44, /* tied */ 0x00114404, /* dbmopen */ 0x00004b04, /* dbmclose */ 0x01111408, /* sselect */ |