diff options
author | Chip Salzenberg <chip@pobox.com> | 2009-10-26 19:39:20 -0700 |
---|---|---|
committer | Chip Salzenberg <chip@pobox.com> | 2009-12-05 20:36:36 -0800 |
commit | 806e7ca7a95b2271bcd698a87bd05a4b9ea9ae68 (patch) | |
tree | 7aa136f5ffc05674f65735e1fd7e1d27b6e9fa58 /sv.c | |
parent | f9c6fee519b868a2e8ef8c5b701c0d3f95565423 (diff) | |
download | perl-806e7ca7a95b2271bcd698a87bd05a4b9ea9ae68.tar.gz |
when removing magic, fix SvMAGICAL flags (unless save_magic is active)
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -5209,12 +5209,14 @@ Perl_sv_unmagic(pTHX_ SV *const sv, const int type) else mgp = &mg->mg_moremagic; } - if (!SvMAGIC(sv)) { + if (SvMAGIC(sv)) { + if (SvMAGICAL(sv)) /* if we're under save_magic, wait for restore_magic; */ + mg_magical(sv); /* else fix the flags now */ + } + else { SvMAGICAL_off(sv); SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT; - SvMAGIC_set(sv, NULL); } - return 0; } |