summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-20 11:54:38 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-20 11:54:38 +0000
commitbf53b3a5f249ae2a059ca8014f7a62d301c554bc (patch)
tree0183c85069e9165086940f61f7ddb80b5b1e4137 /ext
parentaa092aa30938df861825e5192a09d0567bdac529 (diff)
downloadperl-bf53b3a5f249ae2a059ca8014f7a62d301c554bc.tar.gz
xcv_start and xcv_xsubany can be merged into a union, as they are never
both needed. p4raw-id: //depot/perl@27243
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B.xs6
-rw-r--r--ext/Devel/Peek/t/Peek.t12
2 files changed, 15 insertions, 3 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 86dd9d9d67..8271d0425d 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -1636,6 +1636,10 @@ CvSTASH(cv)
B::OP
CvSTART(cv)
B::CV cv
+ CODE:
+ RETVAL = CvISXSUB(cv) ? NULL : CvSTART(cv);
+ OUTPUT:
+ RETVAL
B::OP
CvROOT(cv)
@@ -1678,7 +1682,7 @@ CvXSUBANY(cv)
CODE:
ST(0) = CvCONST(cv) ?
make_sv_object(aTHX_ sv_newmortal(),(SV *)CvXSUBANY(cv).any_ptr) :
- sv_2mortal(newSViv(CvXSUBANY(cv).any_iv));
+ sv_2mortal(newSViv(CvISXSUB(cv) ? CvXSUBANY(cv).any_iv : 0));
MODULE = B PACKAGE = B::CV
diff --git a/ext/Devel/Peek/t/Peek.t b/ext/Devel/Peek/t/Peek.t
index d7b51ee721..6984571af5 100644
--- a/ext/Devel/Peek/t/Peek.t
+++ b/ext/Devel/Peek/t/Peek.t
@@ -17,6 +17,7 @@ print "1..23\n";
our $DEBUG = 0;
open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!";
+
sub do_test {
my $pattern = pop;
if (open(OUT,">peek$$")) {
@@ -30,6 +31,12 @@ sub do_test {
$pattern =~ s/\$FLOAT/(?:\\d*\\.\\d+(?:e[-+]\\d+)?|\\d+)/g;
# handle DEBUG_LEAKING_SCALARS prefix
$pattern =~ s/^(\s*)(SV =.* at )/(?:$1ALLOCATED at .*?\n)?$1$2/mg;
+
+ $pattern =~ s/^ *\$XSUBANY *\n/
+ ($] < 5.009) ? " XSUBANY = 0\n" : '';
+ /mge;
+
+
print $pattern, "\n" if $DEBUG;
my $dump = <IN>;
print $dump, "\n" if $DEBUG;
@@ -51,6 +58,7 @@ our $b;
my $c;
local $d = 0;
+
do_test( 1,
$a = "foo",
'SV = PV\\($ADDR\\) at $ADDR
@@ -213,7 +221,7 @@ do_test(13,
START = $ADDR ===> \\d+
ROOT = $ADDR
XSUB = 0x0
- XSUBANY = 0
+ $XSUBANY
GVGV::GV = $ADDR\\t"main" :: "__ANON__[^"]*"
FILE = ".*\\b(?i:peek\\.t)"
DEPTH = 0
@@ -240,7 +248,7 @@ do_test(14,
START = $ADDR ===> \\d+
ROOT = $ADDR
XSUB = 0x0
- XSUBANY = 0
+ $XSUBANY
GVGV::GV = $ADDR\\t"main" :: "do_test"
FILE = ".*\\b(?i:peek\\.t)"
DEPTH = 1