Permalink
Browse files

fixed issue 80: cvproto (run-time init)

  • Loading branch information...
1 parent 23cf329 commit 204f904968046ae087c49ba576922212818a1c60 Reini Urban committed Dec 20, 2011
Showing with 6 additions and 4 deletions.
  1. +1 −0 MANIFEST
  2. +4 −4 lib/B/C.pm
  3. +1 −0 t/test.pl
View
@@ -123,6 +123,7 @@ t/issue52.t
t/issue54.t
t/issue71.t
t/issue76.t
+t/issue80.t
t/modules.pm
t/modules.t
t/mymodules
View
@@ -2600,9 +2600,6 @@ sub B::CV::save {
my ( $pvsym, $len );
if ($PERL510) {
( $pvsym, $len ) = save_hek($pv);
- if ($len) {
- $pvsym = "(char *)&$pvsym";
- }
# TODO:
# my $ourstash = "0"; # TODO stash name to bless it (test 16: "main::")
if ($PERL514) {
@@ -2761,11 +2758,14 @@ sub B::CV::save {
}
if (!$new_cv_fw) {
$symsect->add(sprintf(
- "SVIX%d\t(XPVCV*)&xpvcv_list[%u], %lu, 0x%x".($PERL510?", {$pvsym}":''),
+ "SVIX%d\t(XPVCV*)&xpvcv_list[%u], %lu, 0x%x".($PERL510?", {0}":''),
$sv_ix, $xpvcv_ix, $cv->REFCNT + ($PERL510 ? 1 : 0), $cv->FLAGS
)
);
}
+ if ($len) {
+ $init->add( sprintf("SvPVX(&sv_list[%d]) = HEK_KEY(%s);", $sv_ix, $pvsym));
+ }
return $sym;
}
View
@@ -642,6 +642,7 @@ sub ctest {
my $runperl = $^X =~ m/\s/ ? qq{"$^X"} : $^X;
my $b = $] > 5.008 ? "-qq,$backend" : "$backend";
+ $b .= q(,-fno-fold,-fno-warnings) if $] >= 5.013005;
system "$runperl -Iblib/arch -Iblib/lib -MO=$b,-o$name.c $name.pl";
unless (-e "$name.c") {
print "not ok $num #B::$backend failed\n";

0 comments on commit 204f904

Please sign in to comment.