diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-03-24 13:54:31 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-03-24 13:54:31 +0000 |
commit | dda0e82829cb66660a3cd10a639eeb06a7cc0917 (patch) | |
tree | c6c047469195d88924ec5d23c887d048df2596ef | |
parent | 410319be38cf59e3f4abf4e02ad9f57622d4d2d5 (diff) | |
download | perl-dda0e82829cb66660a3cd10a639eeb06a7cc0917.tar.gz |
Good catch from Dave Mitchell; plus a null pointer protection.
p4raw-id: //depot/perl@22578
-rw-r--r-- | scope.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |