This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mg.c: Fix U32-to-bool assignment
authorFather Chrysostomos <sprout@cpan.org>
Mon, 12 Aug 2013 22:52:23 +0000 (15:52 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 13 Aug 2013 01:04:07 +0000 (18:04 -0700)
This was caused by 3805b5fb04.  This commit restores the !=0 that
was there before 2fd13eccf0.

Thanks to Steve Hay for helping to track down the smoke failures.

mg.c

diff --git a/mg.c b/mg.c
index 0ce58ab..5741181 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -116,7 +116,7 @@ S_save_magic_flags(pTHX_ I32 mgs_ix, SV *sv, U32 flags)
     mgs = SSPTR(mgs_ix, MGS*);
     mgs->mgs_sv = sv;
     mgs->mgs_magical = SvMAGICAL(sv);
-    mgs->mgs_readonly = SvREADONLY(sv);
+    mgs->mgs_readonly = SvREADONLY(sv) != 0;
     mgs->mgs_ss_ix = PL_savestack_ix;   /* points after the saved destructor */
     mgs->mgs_bumped = bumped;