New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
length($@)>0 for empty $@ if utf8 is in use #9238
Comments
From pajas@ufal.mff.cuni.czCreated by pajas@ufal.mff.cuni.czHi, Perl seems to cache character length of scalars, but in case of $@ The following is reproducible with 5.10.0 and also on 5.8.8 (didn't perl -MCarp -e 'use utf8; eval { die "\x{10d}"}; length($@); print The first eval dies and spits a non-ascii character. Then the -- Petr Perl Info
|
From p5p@spam.wizbit.beOn Mon Mar 03 06:41:54 2008, pajas@ufal.mff.cuni.cz wrote:
Hello, I took a look at this bug-report and the magic assoicated with $@ does I did some testing on how to turn it off but I'm not sure what 'the The test case: #!/usr/bin/perl -l use utf8; The current output (on blead): SV = PV(0x8130f04) at 0x812ffd8 Which shows that the flags SMG and UTF8 are (still) set and the In pp_ctl.c, Perl_create_eval_scope I modified this code: if (flags & G_KEEPERR) Into: if (flags & G_KEEPERR) Which turned the output into: SV = PV(0x814e3a8) at 0x81504f8 Which makes the length 0 but it stil lhas all the extra flags attached Next: I changed it into if (flags & G_KEEPERR) Output: SV = PV(0x814e3a8) at 0x81504f8 Which is the same as the previous output. Next: if (flags & G_KEEPERR) Output: SV = PV(0x814e3a8) at 0x81504f8 Now the MAGIC is gone, but the UTF8 and the flags are still set. Next: if (flags & G_KEEPERR) Output: SV = PV(0x814e3c8) at 0x8150518 Now the MAGIC and the UTF8 are gone but the SMG flag is still there. Next: if (flags & G_KEEPERR) Output: SV = PV(0x814e3e8) at 0x8150538 The MAGIC is gone, the UTF8 is gone, the SMG flag is gone. Next: (back to sv_setpvn instead of sv_setpvn_mg) if (flags & G_KEEPERR) Output: SV = PV(0x814e3e8) at 0x8150538 So, is this the correct way? And: should this be changed in every place where sv_setpvn(ERRSV,"",0) grep -r 'sv_setpvn(ERRSV,"",0);' * # shows that it is used in 9 other And: if it has to change everywhere then what would the best approach (If I know the correct way I'll create a patch with a test case for it) Kind regards, Bram |
The RT System itself - Status changed from 'new' to 'open' |
From @rgs2008/4/26 Animator via RT <perlbug-followup@perl.org>:
The first one should be sv_setpvn actually.
Might be correct. Do all tests pass including the new ones you'll
Probably, yes.
|
From p5p@perl.wizbit.beOn Sun, 27 Apr 2008 23:38:30 +0200, "Rafael Garcia-Suarez"
Writing tests is another issue... What should be tested? That length $@ is empty? (which was the problem in Kind regards, Bram |
From chromatic@wgz.orgOn Sunday 27 April 2008 15:56:41 Bram wrote:
Scraping Devel::Peek output? -- c |
From p5p@perl.wizbit.be
My current plan: Adding Perl_sv_setpvn_clearmg in sv.c which basically contains: Defining sv_setpvn_clearmg in embed.h Changing: sv_setpvn(ERRSV,"",0) into sv_setpvn_clearmg(ERRSV,"",0); Testing-A: eval { 1 }; Testing-B: use Devel::Peek; eval { die "\x{a10d};"; } eval { 1 }; print "ok" if $eval_1 eq $eval_2; The $@ + 0 is needed because the Dump of the second eval always includes: Which the first does not. (Or is there another way to get rid of it?) Can someone comment on this approach? Kind regards, Bram |
From @nwc10On Wed, Apr 30, 2008 at 01:36:40PM +0200, Bram wrote:
In general, are you sure you want that order? Wouldn't it be conceptually more Also, your order mg_free() then mg_clear() is backwards, as mg_clear() will
How many of these are there to change? I don't feel that comfortable with adding another "class" macro of macro for
Well, not literally that as there isn't ; after the second eval. But, um, that example is interesting: $ ./perl -e 'eval { 1 }; eval { die "\x{a10d};"; }; I don't have time to investigate *that* right now.
Assign something that is PVMG to $@ before starting, to ensure that it has $ perl -MDevel::Peek -e '$@ = It's a bit of a hack, but it feels less hacky than a bonus eval. Nicholas Clark |
From p5p@perl.wizbit.beQuoting Nicholas Clark <nick@ccl4.org>:
I'm not sure about it at all...
Copy from an earlier: if (flags & G_KEEPERR) Output: SV = PV(0x814e3c8) at 0x8150518 With the mg_clear added after the mg_free: if (flags & G_KEEPERR) SV = PV(0x814e3e8) at 0x8150538 Whichs shows that it is not a no-op (the SMG flag is gone).
There are 9.
Suggestions for the name of this_clearing_thing?
What version/revision is that? (It never happend with me.) But note, this is what would be fixed by clearing the magic...
I see. Kind regards, Bram |
From @nwc10On Sat, May 03, 2008 at 10:05:10PM +0200, Bram wrote:
Well, actually nor am I, so it comes to detective work...
Well, I don't know, but I grep'ed the core for all uses of mg_free() and int PERL_ARGS_ASSERT_MG_FREE; for (mg = SvMAGIC(sv); mg; mg = moremagic) { and probably should have a line added at the end to reset all the SvFLAGS And then fix up any callers of mg_free() that clear all the SV magic flags
Ah right. I'm not convinced that it's worth it as a one liner function.
#define clear_errsv() STMT_START { ... do stuff ... } STMT_END ?
blead, built with -g and therefore -DDEBUGGING and I think by default UTF-8
I'm a bit confused. mg_clear() clearing the magic?
$ ./perl -e '${^UTF8CACHE} = 0; eval { 1 }; eval { die "\x{a10d};"; }; (0 disables the caching, 1 is caching mode (the non -DDEBUGGING default), -1 Mmm, in the end, reading the documentation and the source, should every Nicholas Clark |
From @nwc10On Sun, May 04, 2008 at 06:03:02PM +0100, Nicholas Clark wrote:
I failed to note, writing this e-mail took half an hour. It adds up. Nicholas Clark |
From p5p@perl.wizbit.beQuoting Nicholas Clark <nick@ccl4.org>:
Could this be it?: (mg_clear calls save_magic which calls SvMAGICAL_off) int PERL_ARGS_ASSERT_MG_CLEAR; save_magic(mgs_ix, sv); for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) { if (vtbl && vtbl->svt_clear) restore_magic(INT2PTR(void*, (IV)mgs_ix)); S_save_magic(pTHX_ I32 mgs_ix, SV *sv) PERL_ARGS_ASSERT_SAVE_MAGIC; assert(SvMAGICAL(sv)); SAVEDESTRUCTOR_X(S_restore_magic, INT2PTR(void*, (IV)mgs_ix)); mgs = SSPTR(mgs_ix, MGS*); SvMAGICAL_off(sv); #define SvMAGICAL_off(sv) (SvFLAGS(sv) &= ~(SVs_GMG|SVs_SMG|SVs_RMG)) (Curently building and testing with a SvMAGICAL_off(sv); after
See the previous mail/the ticket on RT. http://rt.perl.org/rt3/Public/Bug/Display.html?id=51370
Ok.
Rebuilding blead with -g to see if I can get a panic.
The panic would be fixed by clearing the (utf8-)magic that is attached to $@.
As noted in my original messages: that will solve the length issue but I'm completly clueless if that would be a problem or not. Kind regards, Bram |
From @nwc10On Mon, May 05, 2008 at 09:17:35AM +0200, Bram wrote:
It doesn't matter if it has the UTF-8 length caching magic still in place, There wasn't any other magic involved, was there?
Yes, and I'm now not sure why. To my mind, making them all *_mg seems right, Although (I think) that this would allow rather sick things like tie $@ to Nicholas Clark |
From @davidnicolOn Sat, May 3, 2008 at 3:05 PM, Bram <p5p@perl.wizbit.be> wrote:
mg_bono_busboy /* is free, clears tables */ mg_paidoff /* "free and clear" */ |
From p5p@spam.wizbit.beOn Mon Mar 03 06:41:54 2008, pajas@ufal.mff.cuni.cz wrote:
Attached are two patches: errsv_1.txt: errsv_2.txt: In the thread (Clearing magic) Nicholas said: Although (I think) that this would allow rather sick things like tie $@ - this patch changes most of them (not sure if I got them all) into _mg Only one of the two patches has to be applied... Kind regards, Bram |
From p5p@spam.wizbit.beInline Patchdiff -Naur old/perl-current/op.c new/perl-current/op.c
--- old/perl-current/op.c 2008-06-07 16:05:37.000000000 +0200
+++ new/perl-current/op.c 2008-06-07 18:43:01.000000000 +0200
@@ -2521,7 +2521,7 @@
case 3:
/* Something tried to die. Abandon constant folding. */
/* Pretend the error never happened. */
- sv_setpvn(ERRSV,"",0);
+ clear_errsv();
o->op_next = old_next;
break;
default:
diff -Naur old/perl-current/perl.c new/perl-current/perl.c
--- old/perl-current/perl.c 2008-06-07 16:05:41.000000000 +0200
+++ new/perl-current/perl.c 2008-06-07 18:43:04.000000000 +0200
@@ -2679,8 +2679,9 @@
redo_body:
CALL_BODY_SUB((OP*)&myop);
retval = PL_stack_sp - (PL_stack_base + oldmark);
- if (!(flags & G_KEEPERR))
- sv_setpvn(ERRSV,"",0);
+ if (!(flags & G_KEEPERR)) {
+ clear_errsv();
+ }
break;
case 1:
STATUS_ALL_FAILURE;
@@ -2780,8 +2781,9 @@
redo_body:
CALL_BODY_EVAL((OP*)&myop);
retval = PL_stack_sp - (PL_stack_base + oldmark);
- if (!(flags & G_KEEPERR))
- sv_setpvn(ERRSV,"",0);
+ if (!(flags & G_KEEPERR)) {
+ clear_errsv();
+ }
break;
case 1:
STATUS_ALL_FAILURE;
@@ -3559,7 +3561,7 @@
gv_SVadd(PL_errgv);
#endif
sv_grow(ERRSV, 240); /* Preallocate - for immediate signals. */
- sv_setpvn(ERRSV, "", 0);
+ clear_errsv();
PL_curstash = PL_defstash;
CopSTASH_set(&PL_compiling, PL_defstash);
PL_debstash = GvHV(gv_fetchpvs("DB::", GV_ADDMULTI, SVt_PVHV));
diff -Naur old/perl-current/perl.h new/perl-current/perl.h
--- old/perl-current/perl.h 2008-06-07 16:05:37.000000000 +0200
+++ new/perl-current/perl.h 2008-06-07 18:43:05.000000000 +0200
@@ -6008,6 +6008,8 @@
#endif /* Include guard */
+#define clear_errsv() STMT_START { sv_setpvn(ERRSV,"",0); if (SvMAGICAL(ERRSV)) { mg_free(ERRSV); } SvPOK_only(ERRSV); } STMT_END
+
/*
* Local variables:
* c-indentation-style: bsd
diff -Naur old/perl-current/pp_ctl.c new/perl-current/pp_ctl.c
--- old/perl-current/pp_ctl.c 2008-06-07 16:05:34.000000000 +0200
+++ new/perl-current/pp_ctl.c 2008-06-07 18:42:59.000000000 +0200
@@ -2148,8 +2148,9 @@
PL_curpm = newpm; /* ... and pop $1 et al */
LEAVESUB(sv);
- if (clear_errsv)
- sv_setpvn(ERRSV,"",0);
+ if (clear_errsv) {
+ clear_errsv();
+ }
return retop;
}
@@ -3000,8 +3001,9 @@
CopARYBASE_set(PL_curcop, 0);
if (saveop && (saveop->op_type != OP_REQUIRE) && (saveop->op_flags & OPf_SPECIAL))
PL_in_eval |= EVAL_KEEPERR;
- else
- sv_setpvn(ERRSV,"",0);
+ else {
+ clear_errsv();
+ }
if (yyparse() || PL_parser->error_count || !PL_eval_root) {
SV **newsp; /* Used by POPBLOCK. */
PERL_CONTEXT *cx = &cxstack[cxstack_ix];
@@ -3772,8 +3774,9 @@
}
else {
LEAVE;
- if (!(save_flags & OPf_SPECIAL))
- sv_setpvn(ERRSV,"",0);
+ if (!(save_flags & OPf_SPECIAL)) {
+ clear_errsv();
+ }
}
RETURNOP(retop);
@@ -3816,8 +3819,9 @@
PL_in_eval = EVAL_INEVAL;
if (flags & G_KEEPERR)
PL_in_eval |= EVAL_KEEPERR;
- else
- sv_setpvn(ERRSV,"",0);
+ else {
+ clear_errsv();
+ }
if (flags & G_FAKINGEVAL) {
PL_eval_root = PL_op; /* Only needed so that goto works right. */
}
@@ -3876,7 +3880,7 @@
PL_curpm = newpm; /* Don't pop $1 et al till now */
LEAVE;
- sv_setpvn(ERRSV,"",0);
+ clear_errsv();
RETURN;
}
diff -Naur old/perl-current/t/op/eval.t new/perl-current/t/op/eval.t
--- old/perl-current/t/op/eval.t 2008-06-07 16:05:35.000000000 +0200
+++ new/perl-current/t/op/eval.t 2008-06-07 18:42:49.000000000 +0200
@@ -5,7 +5,7 @@
@INC = '../lib';
}
-print "1..95\n";
+print "1..98\n";
eval 'print "ok 1\n";';
@@ -485,4 +485,63 @@
}
+# [perl #51370] eval { die "\x{a10d}" } followed by eval { 1 } did not reset
+# length $@
+$@ = "";
+eval { die "\x{a10d}"; };
+$_ = length $@;
+eval { 1 };
+
+print "not " if ($@ ne "");
+print "ok $test # length of \$@ after eval\n"; $test++;
+
+print "not " if (length $@ != 0);
+print "ok $test # length of \$@ after eval\n"; $test++;
+
+# Check if eval { 1 }; compeltly resets $@
+if (eval "use Devel::Peek; 1;") {
+
+ open PROG, ">", "peek_eval_$$.t" or die "Can't create test file";
+ print PROG <<'END_EVAL_TEST';
+ use Devel::Peek;
+ $! = 0;
+ $@ = $!;
+ my $ok = 0;
+ open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!";
+ if (open(OUT,">peek_eval$$")) {
+ open(STDERR, ">&OUT") or die "Can't dup OUT: $!";
+ Dump($@);
+ print STDERR "******\n";
+ eval { die "\x{a10d}"; };
+ $_ = length $@;
+ eval { 1 };
+ Dump($@);
+ open(STDERR, ">&SAVERR") or die "Can't restore STDERR: $!";
+ close(OUT);
+ if (open(IN, "peek_eval$$")) {
+ local $/;
+ my $in = <IN>;
+ my ($first, $second) = split (/\*\*\*\*\*\*\n/, $in, 2);
+ $first =~ s/,pNOK//;
+ $ok = 1 if ($first eq $second);
+ }
+ }
+
+ print $ok;
+ END {
+ 1 while unlink("peek_eval$$");
+ }
+END_EVAL_TEST
+ close PROG;
+
+ my $ok = runperl(progfile => "peek_eval_$$.t");
+ print "not " unless $ok;
+ print "ok $test # eval { 1 } completly resets \$@\n";
+
+ $test++;
+ 1 while unlink("peek_eval_$$.t");
+}
+else {
+ print "ok $test # skipped - eval { 1 } completly resets \$@";
+}
|
From p5p@spam.wizbit.beInline Patchdiff -Naur old/perl-current/op.c new/perl-current/op.c
--- old/perl-current/op.c 2008-06-07 16:05:37.000000000 +0200
+++ new/perl-current/op.c 2008-06-07 20:22:25.000000000 +0200
@@ -2521,7 +2521,7 @@
case 3:
/* Something tried to die. Abandon constant folding. */
/* Pretend the error never happened. */
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
o->op_next = old_next;
break;
default:
@@ -5719,7 +5719,7 @@
Perl_croak(aTHX_ not_safe);
else {
/* force display of errors found but not reported */
- sv_catpv(ERRSV, not_safe);
+ sv_catpv_mg(ERRSV, not_safe);
Perl_croak(aTHX_ "%"SVf, SVfARG(ERRSV));
}
}
diff -Naur old/perl-current/perl.c new/perl-current/perl.c
--- old/perl-current/perl.c 2008-06-07 16:05:41.000000000 +0200
+++ new/perl-current/perl.c 2008-06-07 20:22:30.000000000 +0200
@@ -2680,7 +2680,7 @@
CALL_BODY_SUB((OP*)&myop);
retval = PL_stack_sp - (PL_stack_base + oldmark);
if (!(flags & G_KEEPERR))
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
break;
case 1:
STATUS_ALL_FAILURE;
@@ -2781,7 +2781,7 @@
CALL_BODY_EVAL((OP*)&myop);
retval = PL_stack_sp - (PL_stack_base + oldmark);
if (!(flags & G_KEEPERR))
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
break;
case 1:
STATUS_ALL_FAILURE;
@@ -3559,7 +3559,7 @@
gv_SVadd(PL_errgv);
#endif
sv_grow(ERRSV, 240); /* Preallocate - for immediate signals. */
- sv_setpvn(ERRSV, "", 0);
+ sv_setpvn_mg(ERRSV, "", 0);
PL_curstash = PL_defstash;
CopSTASH_set(&PL_compiling, PL_defstash);
PL_debstash = GvHV(gv_fetchpvs("DB::", GV_ADDMULTI, SVt_PVHV));
diff -Naur old/perl-current/pp_ctl.c new/perl-current/pp_ctl.c
--- old/perl-current/pp_ctl.c 2008-06-07 16:05:34.000000000 +0200
+++ new/perl-current/pp_ctl.c 2008-06-07 20:22:36.000000000 +0200
@@ -1488,7 +1488,7 @@
PERL_ARGS_ASSERT_QERROR;
if (PL_in_eval)
- sv_catsv(ERRSV, err);
+ sv_catsv_mg(ERRSV, err);
else if (PL_errors)
sv_catsv(PL_errors, err);
else
@@ -1512,7 +1512,7 @@
SV * const err = ERRSV;
const char *e = NULL;
if (!SvPOK(err))
- sv_setpvn(err,"",0);
+ sv_setpvn_mg(err,"",0);
else if (SvCUR(err) >= sizeof(prefix)+msglen-1) {
STRLEN len;
e = SvPV_const(err, len);
@@ -1522,8 +1522,8 @@
}
if (!e) {
SvGROW(err, SvCUR(err)+sizeof(prefix)+msglen);
- sv_catpvn(err, prefix, sizeof(prefix)-1);
- sv_catpvn(err, message, msglen);
+ sv_catpvn_mg(err, prefix, sizeof(prefix)-1);
+ sv_catpvn_mg(err, message, msglen);
if (ckWARN(WARN_MISC)) {
const STRLEN start = SvCUR(err)-msglen-sizeof(prefix)+1;
Perl_warner(aTHX_ packWARN(WARN_MISC), SvPVX_const(err)+start);
@@ -1531,7 +1531,7 @@
}
}
else {
- sv_setpvn(ERRSV, message, msglen);
+ sv_setpvn_mg(ERRSV, message, msglen);
}
}
@@ -2149,7 +2149,7 @@
LEAVESUB(sv);
if (clear_errsv)
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
return retop;
}
@@ -3001,7 +3001,7 @@
if (saveop && (saveop->op_type != OP_REQUIRE) && (saveop->op_flags & OPf_SPECIAL))
PL_in_eval |= EVAL_KEEPERR;
else
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
if (yyparse() || PL_parser->error_count || !PL_eval_root) {
SV **newsp; /* Used by POPBLOCK. */
PERL_CONTEXT *cx = &cxstack[cxstack_ix];
@@ -3037,7 +3037,7 @@
}
else {
if (!*msg) {
- sv_setpvs(ERRSV, "Compilation error");
+ sv_setpvs(ERRSV, "Compilation error"); /* Should this be _mg? sv_setpvs_mg doesn't exist? */
}
}
PERL_UNUSED_VAR(newsp);
@@ -3773,7 +3773,7 @@
else {
LEAVE;
if (!(save_flags & OPf_SPECIAL))
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
}
RETURNOP(retop);
@@ -3817,7 +3817,7 @@
if (flags & G_KEEPERR)
PL_in_eval |= EVAL_KEEPERR;
else
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
if (flags & G_FAKINGEVAL) {
PL_eval_root = PL_op; /* Only needed so that goto works right. */
}
@@ -3876,7 +3876,7 @@
PL_curpm = newpm; /* Don't pop $1 et al till now */
LEAVE;
- sv_setpvn(ERRSV,"",0);
+ sv_setpvn_mg(ERRSV,"",0);
RETURN;
}
diff -Naur old/perl-current/pp_sys.c new/perl-current/pp_sys.c
--- old/perl-current/pp_sys.c 2008-06-07 16:05:38.000000000 +0200
+++ new/perl-current/pp_sys.c 2008-06-07 20:22:39.000000000 +0200
@@ -432,7 +432,7 @@
SV * const error = ERRSV;
SvUPGRADE(error, SVt_PV);
if (SvPOK(error) && SvCUR(error))
- sv_catpvs(error, "\t...caught");
+ sv_catpvs(error, "\t...caught"); /* Shuold this be _mg? sv_catpvs_mg doesn't exist? */
tmpsv = error;
tmps = SvPV_const(tmpsv, len);
}
@@ -485,14 +485,14 @@
PUTBACK;
call_sv((SV*)GvCV(gv),
G_SCALAR|G_EVAL|G_KEEPERR);
- sv_setsv(error,*PL_stack_sp--);
+ sv_setsv_mg(error,*PL_stack_sp--);
}
}
DIE(aTHX_ NULL);
}
else {
if (SvPOK(error) && SvCUR(error))
- sv_catpvs(error, "\t...propagated");
+ sv_catpvs(error, "\t...propagated"); /* Should this be _mg? sv_catpvs_mg doesn't exist? */
tmpsv = error;
if (SvOK(tmpsv))
tmps = SvPV_const(tmpsv, len);
diff -Naur old/perl-current/t/op/eval.t new/perl-current/t/op/eval.t
--- old/perl-current/t/op/eval.t 2008-06-07 16:05:35.000000000 +0200
+++ new/perl-current/t/op/eval.t 2008-06-07 20:23:07.000000000 +0200
@@ -5,7 +5,7 @@
@INC = '../lib';
}
-print "1..95\n";
+print "1..101\n";
eval 'print "ok 1\n";';
@@ -486,3 +486,44 @@
+# [perl #51370] eval { die "\x{a10d}" } followed by eval { 1 } did not reset
+# length $@
+$@ = "";
+eval { die "\x{a10d}"; };
+$_ = length $@;
+eval { 1 };
+
+print "not " if ($@ ne "");
+print "ok $test # length of \$@ after eval\n"; $test++;
+
+print "not " if (length $@ != 0);
+print "ok $test # length of \$@ after eval\n"; $test++;
+
+
+# In [perl #51370] Nicholas wondered wheter all calls with ERRSV should be changed
+# to _mg. This would fix the bug and allow tie'ing and stuff
+{
+ my $ok = 0;
+ my $error = "foo";
+ package Eval2;
+ sub FETCH { $_[0]->[0]; }
+ sub STORE { $_[0]->[0] = $error = $_[1]; }
+ sub TIESCALAR { bless [] }
+
+ tie $@, "Eval2";
+ eval { 1 };
+ print "not " if ($@ ne "");
+ print "ok $test # test a tied \$@\n"; $test++;
+
+ print "not " if ($error ne "");
+ print "ok $test # test a tied \$@\n"; $test++;
+
+ eval { die "ttt\n" };
+ print "not " if ($@ ne "ttt\n");
+ print "ok $test # test a tied \$@\n"; $test++;
+
+ print "not " if ($error ne "ttt\n");
+ print "ok $test # test a tied \$@\n"; $test++;
+}
+
+
diff -Naur old/perl-current/toke.c new/perl-current/toke.c
--- old/perl-current/toke.c 2008-06-07 16:05:41.000000000 +0200
+++ new/perl-current/toke.c 2008-06-07 20:22:42.000000000 +0200
@@ -10652,7 +10652,7 @@
/* Check the eval first */
if (!PL_in_eval && SvTRUE(ERRSV)) {
- sv_catpvs(ERRSV, "Propagated");
+ sv_catpvs(ERRSV, "Propagated"); /* Should this be _mg? sv_catpvs_mg doesn't exist? */
yyerror(SvPV_nolen_const(ERRSV)); /* Duplicates the message inside eval */
(void)POPs;
res = SvREFCNT_inc_simple(sv); |
From @rgs2008/6/11 Bram via RT <perlbug-followup@perl.org>:
Thanks! Change 34069 on 2008/06/17 by rgs@scipion |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#51370 (status was 'resolved')
Searchable as RT51370$
The text was updated successfully, but these errors were encountered: