From: Gurusamy Sarathy Date: Wed, 11 Feb 1998 00:15:51 +0000 (-0500) Subject: [win32] merge a maint patch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=301d9039fb19ffce344369e333240632e80d95d5;p=p5sagit%2Fp5-mst-13.2.git [win32] merge a maint patch Message-Id: <199802110515.AAA23700@aatma.engin.umich.edu> Subject: Re: "local" can crash perl-4.00[34] on Solaris-x86 & FreeBSD p4raw-id: //depot/win32/perl@497 --- diff --git a/pp_ctl.c b/pp_ctl.c index a4135c6..33247e3 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1011,7 +1011,7 @@ dounwind(I32 cxix) while (cxstack_ix > cxix) { cx = &cxstack[cxstack_ix]; DEBUG_l(PerlIO_printf(Perl_debug_log, "Unwinding block %ld, type %s\n", - (long) cxstack_ix+1, block_type[cx->cx_type])); + (long) cxstack_ix, block_type[cx->cx_type])); /* Note: we don't need to restore the base context info till the end. */ switch (cx->cx_type) { case CXt_SUBST: @@ -1347,8 +1347,9 @@ PP(pp_enteriter) SAVESPTR(*svp); } else { - svp = &GvSV((GV*)POPs); /* symbol table variable */ - SAVESPTR(*svp); + GV *gv = (GV*)POPs; + (void)save_scalar(gv); + svp = &GvSV(gv); /* symbol table variable */ } ENTER; diff --git a/t/op/local.t b/t/op/local.t index 3e30306..a034539 100755 --- a/t/op/local.t +++ b/t/op/local.t @@ -2,7 +2,7 @@ # $RCSfile: local.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:04 $ -print "1..24\n"; +print "1..25\n"; sub foo { local($a, $b) = @_; @@ -58,3 +58,13 @@ $a = 'outer'; if (1) { local $a = 'inner' } print +($a eq 'outer') ? "" : "not ", "ok 24\n"; +# see if localization works when scope unwinds + +local $m = 5; +eval { + for $m (6) { + local $m = 7; + die "bye"; + } +}; +print $m == 5 ? "" : "not ", "ok 25\n";