From: Rafael Garcia-Suarez Date: Fri, 23 Jan 2009 13:56:36 +0000 (+0100) Subject: Fix deparsing of constant subroutines X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c7ad0a9c4e0756d4edd2aeba764543bb19cf4be;p=p5sagit%2Fp5-mst-13.2.git Fix deparsing of constant subroutines This was broken in commit 2990415a4519bc3988d7224ae15100c3e9e901ee where the inlined constants were deparsed also _inside_ the subroutine that defined them: that is, before they were available to the parser --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 1407b38..1ee4480 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -3650,7 +3650,7 @@ sub const { return ('undef', '1', $self->maybe_parens("!1", $cx, 21))[$$sv-1]; } elsif (class($sv) eq "NULL") { return 'undef'; - } elsif (my $const = $self->{'inlined_constants'}->{ 0 + $sv->object_2svref }) { + } elsif ($cx and my $const = $self->{'inlined_constants'}->{ 0 + $sv->object_2svref }) { return $const; } # convert a version object into the "v1.2.3" string in its V magic