From 6aaf4108701d03e3663ab149b084be98635a4897 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Wed, 9 Aug 2000 04:49:20 +0000 Subject: [PATCH] B::Deparse didn't do sub attributes. Subject: B::Deparse was Re: [ID 20000808.005] refs to returned lvalues are lvalues?? Message-ID: p4raw-id: //depot/perl@6589 --- ext/B/B.xs | 2 +- ext/B/B/Deparse.pm | 8 ++++++++ ext/B/defsubs_h.PL | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/B/B.xs b/ext/B/B.xs index 9e29855..7704ccd 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1210,7 +1210,7 @@ CvXSUBANY(cv) MODULE = B PACKAGE = B::CV -U8 +U16 CvFLAGS(cv) B::CV cv diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index b6e1097..0e87640 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -14,6 +14,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber OPpLVAL_INTRO OPpENTERSUB_AMPER OPpSLICE OPpCONST_BARE OPpTRANS_SQUASH OPpTRANS_DELETE OPpTRANS_COMPLEMENT OPpTARGET_MY SVf_IOK SVf_NOK SVf_ROK SVf_POK + CVf_METHOD CVf_LOCKED CVf_LVALUE PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED); $VERSION = 0.591; @@ -432,6 +433,13 @@ sub deparse_sub { if ($cv->FLAGS & SVf_POK) { $proto = "(". $cv->PV . ") "; } + if ($cv->CvFLAGS & (CVf_METHOD|CVf_LOCKED|CVf_LVALUE)) { + $proto .= ": "; + $proto .= "lvalue " if $cv->CvFLAGS & CVf_LVALUE; + $proto .= "locked " if $cv->CvFLAGS & CVf_LOCKED; + $proto .= "method " if $cv->CvFLAGS & CVf_METHOD; + } + local($self->{'curcv'}) = $cv; local($self->{'curstash'}) = $self->{'curstash'}; if (not null $cv->ROOT) { diff --git a/ext/B/defsubs_h.PL b/ext/B/defsubs_h.PL index 80ef936..759013b 100644 --- a/ext/B/defsubs_h.PL +++ b/ext/B/defsubs_h.PL @@ -8,6 +8,7 @@ open(OUT,">$out") || die "Cannot open $file:$!"; print "Extracting $out...\n"; foreach my $const (qw(AVf_REAL HEf_SVKEY + CVf_METHOD CVf_LOCKED CVf_LVALUE SVf_IOK SVf_IVisUV SVf_NOK SVf_POK SVf_ROK SVp_IOK SVp_POK )) { -- 2.7.4