Permalink
Browse files

Fixed $$ ($PID) to be dynamic, issue 108. Thanks to flexvault for rep…

…orting this.
  • Loading branch information...
1 parent 7bae5bd commit e049bd9519c93141161b2785fa2e3a2d3b998cd5 @rurban committed Sep 28, 2012
Showing with 5 additions and 0 deletions.
  1. +1 −0 Changes
  2. +4 −0 lib/B/C.pm
View
1 Changes
@@ -32,6 +32,7 @@
Add $dlmodule::VERSION as 2nd arg to boot_$dlmodule resp. $dlmodule::bootstrap
to get rid of the pesky Invalid version format error in xs_version_bootcheck
if the $VERSION had already version magic attached. (no testcase, hard to repro)
+ Fixed $$ ($PID) to be dynamic, issue 108. Thanks to flexvault for reporting this.
* CC (1.13): added check_entersub, check_bless - bless and new caching
* Bytecode (1.14): fixed require and op_first, issue 97
Fixed regex_pad offset in threaded perls >= 5.11, issue 68
View
4 lib/B/C.pm
@@ -3618,6 +3618,10 @@ if (0) {
$gvsv->save($fullname); #mostly NULL. $gvsv->isa("B::NULL");
$init->add( sprintf( "GvSVn($sym) = (SV*)s\\_%x;", $$gvsv ) );
}
+ if ($fullname eq 'main::$') { # $$ = PerlProc_getpid() issue #108
+ warn sprintf( " GV $sym \$\$ perlpid\n") if $debug{gv};
+ $init->add( "sv_setiv(GvSV($sym), (IV)PerlProc_getpid());" );
+ }
warn "GV::save \$$fullname\n" if $debug{gv};
}
my $gvav = $gv->AV;

0 comments on commit e049bd9

Please sign in to comment.