From 6575cde09f3b8f22b60ff3c736fc7fba3ee0ef00 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 8 Nov 2014 12:54:37 -0800 Subject: 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.) --- regen/opcodes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'regen/opcodes') diff --git a/regen/opcodes b/regen/opcodes index 7105c7f6eb..24a4aa8af7 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -328,7 +328,7 @@ binmode binmode ck_fun s@ F S? tie tie ck_fun idms@ R S L untie untie ck_fun is% R -tied tied ck_fun s% R +tied tied ck_fun ds% R dbmopen dbmopen ck_fun is@ H S S dbmclose dbmclose ck_fun is% H -- cgit v1.2.1