-
Notifications
You must be signed in to change notification settings - Fork 558
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
$@ = 100; die doesn't propagate 100 #17098
Comments
From @tonycoztoddr pointed this out in IRC: 05:50 < toddr> TonyC after 8b3945e, the output Similarly for NVs. tony@mars:.../git/perl$ ./perl -e '$@ = 123; die' Patch soon Perl Info
|
From @tonycozOn Tue, 16 Jul 2019 18:07:14 -0700, tonyc wrote:
Attached. I'll apply this soon. Tony |
From @tonycoz0001-perl-134291-propagate-non-PVs-in-in-bare-die.patchFrom dac821a895ae3a7d26ea9f9f6b6d2e48592a3fe0 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 17 Jul 2019 11:32:50 +1000
Subject: (perl #134291) propagate non-PVs in $@ in bare die()
---
pp_sys.c | 2 +-
t/op/die.t | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/pp_sys.c b/pp_sys.c
index 0214367ea6..251527785e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -498,7 +498,7 @@ PP(pp_die)
}
}
}
- else if (SvPOK(errsv) && SvCUR(errsv)) {
+ else if (SvOK(errsv) && (SvPV_nomg(errsv,len), len)) {
exsv = sv_mortalcopy(errsv);
sv_catpvs(exsv, "\t...propagated");
}
diff --git a/t/op/die.t b/t/op/die.t
index ef2b85f8f5..d6d7daffa5 100644
--- a/t/op/die.t
+++ b/t/op/die.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc('../lib');
}
-plan tests => 20;
+plan tests => 21;
eval {
eval {
@@ -94,6 +94,10 @@ like($@, qr/\.{3}propagated at/, '... and appends a phrase');
local $SIG{__WARN__} = sub { $ok = 0 };
eval { undef $@; die };
is( $ok, 1, 'no warnings if $@ is undef' );
+
+ eval { $@ = 100; die };
+ like($@."", qr/100\t\.{3}propagated at/,
+ 'check non-PVs in $@ are propagated');
}
TODO: {
--
2.11.0
|
From @toddrCreated by @toddrWe noticed today that die will not display $@ if it's an IV
I bisected it to a change just before 5.18: 8b3945e is the first bad commit [perl #117743] don't warn on $@ = undef; die; and fix the test that's meant to detect this bug. :100644 100644 8bf9fa7cf13daf5e5461c945266a9579c5ac0590 Perl Info
|
From nicolas@atoomic.orgthis is a duplicate of what was reported and fixed earlier by Tony via RT #134291 |
The RT System itself - Status changed from 'new' to 'open' |
@tonycoz - Status changed from 'new' to 'pending release' |
Migrated from rt.perl.org#134291 (status was 'pending release')
Searchable as RT134291$
The text was updated successfully, but these errors were encountered: