diff options
author | Yitzchak Scott-Thoennes <sthoenna@efn.org> | 2005-09-01 17:05:52 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-09-06 14:50:18 +0000 |
commit | 2b77b520a897b2de1a476dfdd714900e49cf942b (patch) | |
tree | c94b568e37e322a0c21f107956cc5a9bbde60d1c /mg.c | |
parent | 44c87379b0eb26068458a7274e6ba030624f8ac1 (diff) | |
download | perl-2b77b520a897b2de1a476dfdd714900e49cf942b.tar.gz |
Re: Fw: Tied hash numeric values are rounded off under Perl v5.8.6
Message-ID: <20050902070552.GA3992@efn.org>
p4raw-id: //depot/perl@25358
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -2793,8 +2793,16 @@ S_restore_magic(pTHX_ const void *p) SvFLAGS(sv) |= mgs->mgs_flags; else mg_magical(sv); - if (SvGMAGICAL(sv)) - SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK|SVf_POK); + if (SvGMAGICAL(sv)) { + /* downgrade public flags to private, + and discard any other private flags */ + + U32 public = SvFLAGS(sv) & (SVf_IOK|SVf_NOK|SVf_POK); + if (public) { + SvFLAGS(sv) &= ~( public | SVp_IOK|SVp_NOK|SVp_POK ); + SvFLAGS(sv) |= ( public << PRIVSHIFT ); + } + } } mgs->mgs_sv = NULL; /* mark the MGS structure as restored */ |