Skip to content

Hide function prototyes from unauthorized callers #23570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: blead
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
: comments here mostly don't include how Devel::PPPort or diag.t use them:
: All the possible flags and their meanings are given below.
:
: A function taking no parameters will have no 'arg' elements.
: A function taking no parameters will have no 'arg' elements. Currently
: arguments that are function pointers are unlikely to be parsed properly here
: (patches welcome!); you can work around this by creating a typedef for the
: function pointer, in an appropriate header file and using that here.
:
: A line may be continued onto the next by ending it with a backslash.
: Leading and trailing whitespace will be ignored in each component.
:
Expand Down Expand Up @@ -112,6 +116,8 @@
: perlintern. If no documentation exists, that fact is also noted in
: perlintern.
:
: Use the 'X' flag instead to suppress the short name outside the core
:
: These require one of the /[iIpS]/ flags to give callers a name to use
: that won't possibly collide with their own
:
Expand Down Expand Up @@ -1306,7 +1312,7 @@ ERXp |SV * |get_prop_definition \
ERTXp |const char * const *|get_prop_values \
|const int table_index
: Used by SvRX and SvRXOK
EXopx |REGEXP *|get_re_arg |NULLOK SV *sv
Xopx |REGEXP *|get_re_arg |NULLOK SV *sv
AOdp |SV * |get_sv |NN const char *name \
|I32 flags
CRipx |MGVTBL *|get_vtbl |int vtbl_id
Expand Down Expand Up @@ -2068,7 +2074,7 @@ Cp |const char *|moreswitches \
Adp |void |mortal_destructor_sv \
|NN SV *coderef \
|NULLOK SV *args
CRTXip |char * |mortal_getenv |NN const char *str
CRTip |char * |mortal_getenv |NN const char *str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of libperl's *getenv*() are messy, especially WinPerl's sandwich of functions and macros. 3 identical SV mortals/Newx blocks are made each time on WinPerl for no reason right now since Perl mid-5.30s.

I think but im not sure unless i do a deep dive study, that this function is one of the functions that will become semi-public CPAN API if WinPerl becomes MS UTF16-aware in the near future.

Cdp |void |mortal_svfunc_x|SVFUNC_t f \
|NULLOK SV *p
Adop |const struct mro_alg *|mro_get_from_name \
Expand Down Expand Up @@ -3688,9 +3694,9 @@ Cp |UV |_to_utf8_upper_flags \
|NULLOK STRLEN *lenp \
|bool flags

EXop |bool |try_amagic_bin |int method \
Xop |bool |try_amagic_bin |int method \
|int flags
EXop |bool |try_amagic_un |int method \
Xop |bool |try_amagic_un |int method \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

B::C and B::CC style modules may might want these symbols, but I have wanted to not-delete them and do major plastic surgery on their C prototypes/parameter order/parameter meanings for many months now.

The branch is 40% done and not syntax error-ing on 1 on these overload.pm getter callouts, I'm targeting -X file test operators first in my branch, because they have the worst abstraction split, between what the pp_*() func is responsible for and what the Public-to-CORE-only front-end C functions of overload.pm API are responsible for.

its mostly about this string/expression PL_op->op_type and is it caller function (the pp_*()s) or callee functions (overload.pm front ends) that derefs my_perl->Iop->op_type and do a tree of if/else branch logic on the U16 inside op_type

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

B::C and B::CC style modules may might want these symbols, but I have wanted to not-delete them and do major plastic surgery on their C prototypes/parameter order/parameter meanings for many months now.

Would there is any interest from Unix only P5P ppl, to make the Win32/Win64 GH CI runners, dump the real symbol table of perl5xx.dll to STDERR/STDOUT inside a Win32/Win64 GH CI runner on each build?

Its 1279 lines (C symbols) long on perl543.dll right now.

|int flags
ARTdp |char * |uiv_2buf |NN char * const buf \
|const IV iv \
Expand Down Expand Up @@ -6297,7 +6303,7 @@ EXopx |OP * |pp_wrap |NN Perl_ppaddr_t real_pp_fn \
|I32 nargs \
|int nlists
Cpx |int |runops_wrap
EXopx |void |xs_wrap |NN XSUBADDR_t xsub \
Copx |void |xs_wrap |NN XSUBADDR_t xsub \
|NN CV *cv
#endif
#if defined(PERL_USE_3ARG_SIGHANDLER)
Expand Down
Loading
Loading