diff --git a/builtin.c b/builtin.c index 34865ec9a4bb..acd5635e2cae 100644 --- a/builtin.c +++ b/builtin.c @@ -490,9 +490,12 @@ static OP *ck_builtin_func1(pTHX_ OP *entersubop, GV *namegv, SV *ckobj) } } -XS(XS_builtin_indexed) +/* This does not use the XS() macro so that op.c can see its prototype */ +void +Perl_XS_builtin_indexed(pTHX_ CV *cv) { dXSARGS; + PERL_ARGS_ASSERT_XS_BUILTIN_INDEXED; switch(GIMME_V) { case G_VOID: @@ -638,7 +641,7 @@ static const struct BuiltinFuncDescriptor builtins[] = { { "load_module", NO_BUNDLE, &XS_builtin_load_module, &ck_builtin_func1, 0, true }, /* list functions */ - { "indexed", SHORTVER(5,39), &XS_builtin_indexed, &ck_builtin_funcN, 0, false }, + { "indexed", SHORTVER(5,39), &Perl_XS_builtin_indexed, &ck_builtin_funcN, 0, false }, { "export_lexically", NO_BUNDLE, &XS_builtin_export_lexically, NULL, 0, true }, { NULL, 0, NULL, NULL, 0, false } diff --git a/embed.fnc b/embed.fnc index f0d1dedb1485..b07525d90220 100644 --- a/embed.fnc +++ b/embed.fnc @@ -4088,6 +4088,8 @@ p |void |finish_export_lexical p |void |import_builtin_bundle \ |U16 ver p |void |prepare_export_lexical +p |void |XS_builtin_indexed \ + |NN CV *cv #endif #if defined(PERL_IN_CLASS_C) || defined(PERL_IN_OP_C) || \ defined(PERL_IN_PAD_C) || defined(PERL_IN_PERLY_C) || \ diff --git a/embed.h b/embed.h index 8f890fba4df4..f3a9c9ca17e0 100644 --- a/embed.h +++ b/embed.h @@ -1202,6 +1202,7 @@ # define get_aux_mg(a) S_get_aux_mg(aTHX_ a) # endif # if defined(PERL_IN_BUILTIN_C) || defined(PERL_IN_OP_C) +# define XS_builtin_indexed(a) Perl_XS_builtin_indexed(aTHX_ a) # define finish_export_lexical() Perl_finish_export_lexical(aTHX) # define import_builtin_bundle(a) Perl_import_builtin_bundle(aTHX_ a) # define prepare_export_lexical() Perl_prepare_export_lexical(aTHX) diff --git a/op.c b/op.c index bc8df993cfaa..9dc1c79dc1cc 100644 --- a/op.c +++ b/op.c @@ -171,9 +171,6 @@ recursive, but it's recursive on basic blocks, not on tree nodes. static const char array_passed_to_stat[] = "Array passed to stat will be coerced to a scalar"; -/* UGH!! */ -EXTERN_C void XS_builtin_indexed(pTHX_ CV *); - /* remove any leading "empty" ops from the op_next chain whose first * node's address is stored in op_p. Store the updated address of the * first node in op_p. @@ -9825,7 +9822,7 @@ Perl_newFOROP(pTHX_ I32 flags, OP *sv, OP *expr, OP *block, OP *cont) if(firstarg == lastarg) firstarg = NULL; - if (op_is_cv_xsub(lastarg, &XS_builtin_indexed) && /* a call to builtin::indexed */ + if (op_is_cv_xsub(lastarg, &Perl_XS_builtin_indexed) && /* a call to builtin::indexed */ firstarg && OpSIBLING(firstarg) == lastarg && /* with one arg */ (firstarg->op_type == OP_RV2AV || firstarg->op_type == OP_PADAV) /* ... which is an array */ ) { diff --git a/proto.h b/proto.h index 65fe5c5bd68c..c64cad758b11 100644 --- a/proto.h +++ b/proto.h @@ -6202,6 +6202,12 @@ S_get_aux_mg(pTHX_ AV *av); #endif #if defined(PERL_IN_BUILTIN_C) || defined(PERL_IN_OP_C) +PERL_CALLCONV void +Perl_XS_builtin_indexed(pTHX_ CV *cv) + __attribute__visibility__("hidden"); +# define PERL_ARGS_ASSERT_XS_BUILTIN_INDEXED \ + assert(cv); assert(SvTYPE(cv) == SVt_PVCV || SvTYPE(cv) == SVt_PVFM) + PERL_CALLCONV void Perl_finish_export_lexical(pTHX) __attribute__visibility__("hidden");