From: Yves Orton Date: Thu, 22 Sep 2005 11:31:02 +0000 (-0700) Subject: [perl #37233] [PATCH] Test::Harness and Devel::Cover combine with overloading to... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a7acfb9b07364b45423d76a5a3e8a6d629465ec;p=p5sagit%2Fp5-mst-13.2.git [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: p4raw-id: //depot/perl@25679 --- diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm index 79aa5f8..f86b7b4 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);