diff options
author | Yves Orton <demerphq@gmail.com> | 2005-09-22 04:31:02 -0700 |
---|---|---|
committer | Steve Peters <steve@fisharerojo.org> | 2005-10-02 12:50:02 +0000 |
commit | 8a7acfb9b07364b45423d76a5a3e8a6d629465ec (patch) | |
tree | d6d171ceb018890a6f62fa6627434d1f2c7b940c | |
parent | cde9c2113453df62687a8b4e5904da70e91f3a36 (diff) | |
download | perl-8a7acfb9b07364b45423d76a5a3e8a6d629465ec.tar.gz |
[perl #37233] [PATCH] Test::Harness and Devel::Cover combine with overloading to cause infinite recursion in Carp.pm
From: perlbug-followup[at]perl.org (Yves Orton)
Message-ID: <rt-3.0.11-37233-121233.2.25543632691242[at]perl.org>
p4raw-id: //depot/perl@25679
-rw-r--r-- | lib/Carp/Heavy.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm index 79aa5f8f9b..f86b7b4371 100644 --- a/lib/Carp/Heavy.pm +++ b/lib/Carp/Heavy.pm @@ -103,11 +103,10 @@ sub caller_info { # Transform an argument to a function into a string. sub format_arg { my $arg = shift; - if (not defined($arg)) { - $arg = 'undef'; - } - elsif (ref($arg)) { + if (ref($arg)) { $arg = defined($overload::VERSION) ? overload::StrVal($arg) : "$arg"; + }elsif (not defined($arg)) { + $arg = 'undef'; } $arg =~ s/'/\\'/g; $arg = str_len_trim($arg, $MaxArgLen); |