Permalink
Browse files

C: fix perl5.18.1d t/issue130.t: CUR on undefined sv

Can't call method "CUR" on an undefined value at blib/lib/B/C.pm line 1814.
  • Loading branch information...
1 parent a76fd7b commit f9dbfb75e5bb4a4a2437446145adc72fe66f2b0d @rurban committed Nov 20, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/B/C.pm
View
3 lib/B/C.pm
@@ -1811,7 +1811,8 @@ sub savepvn {
}
} else {
warn sprintf( "Saving PV %s to %s\n", cstring($pv), $dest ) if $debug{sv};
- push @init, sprintf( "%s = savepvn(%s, %u);", $dest, cstring($pv), $sv->CUR );
+ my $cur = $sv ? $sv->CUR : length(pack "a*", $pv);
+ push @init, sprintf( "%s = savepvn(%s, %u);", $dest, cstring($pv), $cur );
}
}
return @init;

0 comments on commit f9dbfb7

Please sign in to comment.