summaryrefslogtreecommitdiff
path: root/ext/XS-APItest
diff options
context:
space:
mode:
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r--ext/XS-APItest/APItest.xs10
-rw-r--r--ext/XS-APItest/t/gv_autoload4.t16
2 files changed, 13 insertions, 13 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 618bd32dc8..6ef52d1b8f 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -1953,29 +1953,29 @@ gv_fetchmethod_flags_type(stash, methname, type, flags)
XPUSHs( gv ? (SV*)gv : &PL_sv_undef);
void
-gv_autoload_type(stash, methname, type, method, flags)
+gv_autoload_type(stash, methname, type, method)
HV* stash
SV* methname
int type
I32 method
- I32 flags
PREINIT:
STRLEN len;
const char * const name = SvPV_const(methname, len);
GV* gv;
+ I32 flags = method ? GV_AUTOLOAD_ISMETHOD : 0;
PPCODE:
switch (type) {
case 0:
gv = gv_autoload4(stash, name, len, method);
break;
case 1:
- gv = gv_autoload_sv(stash, methname, method, flags);
+ gv = gv_autoload_sv(stash, methname, flags);
break;
case 2:
- gv = gv_autoload_pv(stash, name, method, flags | SvUTF8(methname));
+ gv = gv_autoload_pv(stash, name, flags | SvUTF8(methname));
break;
case 3:
- gv = gv_autoload_pvn(stash, name, len, method, flags | SvUTF8(methname));
+ gv = gv_autoload_pvn(stash, name, len, flags | SvUTF8(methname));
break;
}
XPUSHs( gv ? (SV*)gv : &PL_sv_undef);
diff --git a/ext/XS-APItest/t/gv_autoload4.t b/ext/XS-APItest/t/gv_autoload4.t
index dc4e2270a8..1f57437168 100644
--- a/ext/XS-APItest/t/gv_autoload4.t
+++ b/ext/XS-APItest/t/gv_autoload4.t
@@ -18,27 +18,27 @@ sub AUTOLOAD {
my $sub = "nothing";
-ok my $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method, 0);
+ok my $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, '$AUTOLOAD set correctly' );
$sub = "some_sub";
for my $type ( 0..3 ) {
- is $glob = XS::APItest::gv_autoload_type(\%::, $sub, $type, $method, 0), "*main::AUTOLOAD", "*main::AUTOLOAD if autoload is true in $types[$type].";
+ is $glob = XS::APItest::gv_autoload_type(\%::, $sub, $type, $method), "*main::AUTOLOAD", "*main::AUTOLOAD if autoload is true in $types[$type].";
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, '$AUTOLOAD set correctly' );
}
$sub = "method\0not quite!";
-ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 0, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 0, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload4() is nul-clean");
-ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 1, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload_sv() is nul-clean");
-ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 2, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 2, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . ($sub =~ s/\0.*//r), "gv_autoload_pv() is not nul-clean");
-ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 3, $method, 0);
+ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 3, $method);
*{$glob}{CODE}->( __PACKAGE__ . "::" . $sub, "gv_autoload_pvn() is nul-clean");
=begin
@@ -55,9 +55,9 @@ ok $glob = XS::APItest::gv_autoload_type(\%::, $sub, 3, $method, 0);
}
for my $type ( 1..3 ) {
- ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method, 0);
+ ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method);
*{$glob}{CODE}->( "main::" . $sub, "$types[$type]() is UTF8-clean when both the stash and the sub are in UTF-8");
- ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method, 0);
+ ::ok $glob = XS::APItest::gv_autoload_type(\%main::, $sub = "method", $type, $method);
*{$glob}{CODE}->( "main::" . $sub, "$types[$type]() is UTF8-clean when only the stash is in UTF-8");
}
}