diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-07-15 00:05:57 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-07-15 19:14:22 -0700 |
commit | ff44333e5a9d9dca5272bb166df463607ebd3020 (patch) | |
tree | c8cf9c78f0393387b4a19478209e1a074cbb9314 /embed.h | |
parent | f4245ada08d64d9ac0a9bc6c6c17e4d10ddcffc2 (diff) | |
download | perl-ff44333e5a9d9dca5272bb166df463607ebd3020.tar.gz |
Make set-magic handle vstrings properly
Assigning a vstring to a tied variable would result in a plain string
in $_[1] in STORE.
Assigning a vstring to a magic deferred element would result in a
plain string in the aggregate’s actual element.
When magic is invoked, the magic flags are temporarily turned off on
the sv so that recursive calls to magic don’t happen. This makes it
easier to implement functions like Perl_magic_set to read the value of
the sv without triggering get-magic.
Since vstrings are only considered vstrings when they are SvRMAGICAL,
this meant that set-magic would turn vstrings temporarily into plain
strings. Subsequent copying (e.g., in STORE) would then fail to copy
the vstring magic.
This commit changes mg_set to leave the rmagical flag on, since it
does not affect the functionaiity of set-magic.
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1395,7 +1395,7 @@ #define magic_methcall1(a,b,c,d,e,f) S_magic_methcall1(aTHX_ a,b,c,d,e,f) #define magic_methpack(a,b,c) S_magic_methpack(aTHX_ a,b,c) #define restore_magic(a) S_restore_magic(aTHX_ a) -#define save_magic(a,b) S_save_magic(aTHX_ a,b) +#define save_magic_flags(a,b,c) S_save_magic_flags(aTHX_ a,b,c) #define unwind_handler_stack(a) S_unwind_handler_stack(aTHX_ a) # endif # if defined(PERL_IN_MG_C) || defined(PERL_IN_PP_C) |