From: Rafael Garcia-Suarez Date: Wed, 24 Mar 2004 13:54:31 +0000 (+0000) Subject: Good catch from Dave Mitchell; plus a null pointer protection. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dda0e82829cb66660a3cd10a639eeb06a7cc0917;p=p5sagit%2Fp5-mst-13.2.git Good catch from Dave Mitchell; plus a null pointer protection. p4raw-id: //depot/perl@22578 --- diff --git a/scope.c b/scope.c index 86587e3..cb56959 100644 --- a/scope.c +++ b/scope.c @@ -217,8 +217,8 @@ S_save_scalar_at(pTHX_ SV **sptr) /* if it's a special scalar or if it has no 'set' magic, * propagate the SvREADONLY flag. --rgs 20030922 */ for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) { - if (SvMAGIC(sv)->mg_type == '\0' - || !SvMAGIC(sv)->mg_virtual->svt_set) + if (mg->mg_type == '\0' + || !(mg->mg_virtual && mg->mg_virtual->svt_set)) { SvFLAGS(sv) |= SvREADONLY(osv); break;