summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pp_sys.c2
-rw-r--r--t/op/die.t6
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: {