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
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:
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;
# $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) = @_;
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";