Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do not initialize CONSTSUB XS methods twice

boot does it for us
  • Loading branch information...
commit a6ed5a7b68e26c1705f6b17f58161760d1151b1f 1 parent 83eebad
@rurban authored
Showing with 20 additions and 16 deletions.
  1. +4 −1 Changes
  2. +16 −15 lib/B/C.pm
View
5 Changes
@@ -23,8 +23,11 @@
Store CV prototypes, issue 81 and issue 84 for empty () vs NULL prototypes.
Fixed 5.15.2 hang at hfree_next_entry (issue 78)
Defer writing of READONLY hash keys since 5.15 (issue 88)
- Enable -fcog copy-on-grow with static strings for >= 5.10
+ Enable -fcog copy-on-grow with static strings for >= 5.10 (broke -O1)
Improved Errno vs. *main::! and Tie::Hash::NamedCapture vs *main::+ / - logic (issue 90)
+ Updated version XS methods, default to noop for (...
+ Strip version object overload from XS packages (issue 91), XS needs plain PVs
+ Do not initialize CONSTSUB XS methods twice, boot does it for us
* CC (1.12): allow overriding of -f<opt> B::C flags
* Bytecode (1.12): detect Tie::Hash::NamedCapture (issue 90)
support -d debugging without -MOd
View
31 lib/B/C.pm
@@ -2352,20 +2352,6 @@ sub B::CV::save {
{ no strict 'subs';
$isconst = $PERL56 ? 0 : $cv->CvFLAGS & CVf_CONST;
}
- if ($isconst and !($cv->CvFLAGS & CVf_ANON)) {
- my $stash = $gv->STASH;
- warn sprintf( "CV CONST 0x%x %s::%s\n", $$gv, $cvstashname, $cvname )
- if $debug{cv};
- # warn sprintf( "%s::%s\n", $cvstashname, $cvname) if $debug{sub};
- my $stsym = $stash->save;
- my $name = cstring($cvname);
- my $vsym = $cv->XSUBANY->save;
- $decl->add("Static CV* cv$cv_index;");
- $init->add("cv$cv_index = newCONSTSUB( $stsym, $name, (SV*)$vsym );");
- my $sym = savesym( $cv, "cv$cv_index" );
- $cv_index++;
- return $sym;
- }
if ( !$isconst && $cvxsub && ( $cvname ne "INIT" ) ) {
my $egv = $gv->EGV;
@@ -2463,7 +2449,7 @@ sub B::CV::save {
# and we want to allow a patched libperl.
warn "Warning: DynaLoader broken with 5.15.2-5.15.3.\n".
" Use 0001-Export-DynaLoader-symbols-from-libperl-again.patch in [perl #100138]"
- unless $B::C::DynaLoader_warn;
+ unless $B::C::DynaLoader_warn;
$B::C::DynaLoader_warn++;
}
$decl->add("XS($xs);");
@@ -2476,6 +2462,21 @@ sub B::CV::save {
return svref_2object( \&Dummy_initxs )->save;
}
+ if ($isconst and !($cv->CvFLAGS & CVf_ANON)) {
+ my $stash = $gv->STASH;
+ warn sprintf( "CV CONST 0x%x %s::%s\n", $$gv, $cvstashname, $cvname )
+ if $debug{cv};
+ # warn sprintf( "%s::%s\n", $cvstashname, $cvname) if $debug{sub};
+ my $stsym = $stash->save;
+ my $name = cstring($cvname);
+ my $vsym = $cv->XSUBANY->save;
+ $decl->add("Static CV* cv$cv_index;");
+ $init->add("cv$cv_index = newCONSTSUB( $stsym, $name, (SV*)$vsym );");
+ my $sym = savesym( $cv, "cv$cv_index" );
+ $cv_index++;
+ return $sym;
+ }
+
# This define is forwarded to the real sv below
# The new method, which saves a SV only works since 5.10 (? Does not work in newer perls)
my $sv_ix = $svsect->index + 1;
Please sign in to comment.
Something went wrong with that request. Please try again.