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
"in cleanup" warnings generated from destructor errors are no longer enabled by "use warnings" #12214
Comments
From @doyCreated by @doy../bisect.pl --start=v5.12.4 --end=v5.14.2 --expect-fail -e \ returns this: 96d9b9c is the first bad commit make die reliably hand error to post-eval code Put the exception into $@ last thing before longjmping to the op following :100644 100644 5ca4f13aa00796d3864bcc7258510dd7de56986d 6ae162687a665f15ba1c38080a58c8cc310b65a4 M MANIFEST But this still warns: $ perl -we 'package A; sub new { bless {}, "A" } sub DESTROY { die "foo" } This seems unintentional. The code seems to still be using the 'misc' Perl Info
|
From zefram@fysh.orgJesse Luehrs wrote:
Indeed. The Perl_ck_warner() call in die_unwind() used to happen before Assuming we want to revert this change, the easy fix is to move Patch attached. -zefram |
From zefram@fysh.orgInline Patchdiff --git a/pp_ctl.c b/pp_ctl.c
index c9d833f..b5daf63 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1638,6 +1638,11 @@ Perl_die_unwind(pTHX_ SV *msv)
sv_setsv(ERRSV, exceptsv);
}
+ if (in_eval & EVAL_KEEPERR) {
+ Perl_ck_warner(aTHX_ packWARN(WARN_MISC), "\t(in cleanup) %"SVf,
+ SVfARG(exceptsv));
+ }
+
while ((cxix = dopoptoeval(cxstack_ix)) < 0
&& PL_curstackinfo->si_prev)
{
@@ -1696,13 +1701,8 @@ Perl_die_unwind(pTHX_ SV *msv)
SVfARG(exceptsv ? exceptsv : newSVpvs_flags("Unknown error\n",
SVs_TEMP)));
}
- if (in_eval & EVAL_KEEPERR) {
- Perl_ck_warner(aTHX_ packWARN(WARN_MISC), "\t(in cleanup) %"SVf,
- SVfARG(exceptsv));
- }
- else {
+ if (!(in_eval & EVAL_KEEPERR))
sv_setsv(ERRSV, exceptsv);
- }
PL_restartjmpenv = restartjmpenv;
PL_restartop = restartop;
JMPENV_JUMP(3);
diff --git a/t/op/die_keeperr.t b/t/op/die_keeperr.t
index 9b41cb5..083bd5d 100644
--- a/t/op/die_keeperr.t
+++ b/t/op/die_keeperr.t
@@ -3,7 +3,7 @@
BEGIN {
chdir 't' if -d 't';
require 'test.pl';
- plan(20);
+ plan(24);
}
sub End::DESTROY { $_[0]->() }
@@ -31,14 +31,45 @@ foreach my $inx ("", "aabbcc\n", [qw(aa bb cc)]) {
no warnings "misc";
my $warn = "";
local $SIG{__WARN__} = sub { $warn .= $_[0] };
- { my $e = end { die "aa\n"; }; }
+ { my $e = end { no warnings "misc"; die "aa\n"; }; }
is $warn, "";
}
{
+ no warnings "misc";
+ my $warn = "";
+ local $SIG{__WARN__} = sub { $warn .= $_[0] };
+ { my $e = end { use warnings "misc"; die "aa\n"; }; }
+ is $warn, "\t(in cleanup) aa\n";
+}
+
+{
my $warn = "";
local $SIG{__WARN__} = sub { $warn .= $_[0] };
{ my $e = end { no warnings "misc"; die "aa\n"; }; }
+ is $warn, "";
+}
+
+{
+ my $warn = "";
+ local $SIG{__WARN__} = sub { $warn .= $_[0] };
+ { my $e = end { use warnings "misc"; die "aa\n"; }; }
+ is $warn, "\t(in cleanup) aa\n";
+}
+
+{
+ use warnings "misc";
+ my $warn = "";
+ local $SIG{__WARN__} = sub { $warn .= $_[0] };
+ { my $e = end { no warnings "misc"; die "aa\n"; }; }
+ is $warn, "";
+}
+
+{
+ use warnings "misc";
+ my $warn = "";
+ local $SIG{__WARN__} = sub { $warn .= $_[0] };
+ { my $e = end { use warnings "misc"; die "aa\n"; }; }
is $warn, "\t(in cleanup) aa\n";
}
|
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgI wrote:
Bah, breaks an XS-APItest test. That needs updating, similarly to -zefram |
From @rjbsOn Thu Mar 28 04:14:26 2013, zefram@fysh.org wrote:
I have made the update and applied it experimentally in the branch rjbs/rt-113794 I would appreciate some eyes on this before I pull it into blead. -- |
From @rjbsOn Thu Mar 28 04:09:20 2013, zefram@fysh.org wrote:
I wanted to get on record saying that my attempt to get this patch applied was not (mere) -- |
From @rjbsI landed this change this morning. -- |
From [Unknown Contact. See original ticket]I landed this change this morning. -- |
@rjbs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#113794 (status was 'resolved')
Searchable as RT113794$
The text was updated successfully, but these errors were encountered: