Skip to content

Commit 5e6221d

Browse files
committed
fix type of S_restore_magic and S_unwind_handler_stack
SAVEDESTRUCTOR_X needs a function of type 'void (pTHX_ void *)' exactly. Should fix this ASan error: scope.c:1543:13: runtime error: call to function S_restore_magic through pointer to incorrect function type 'void (*)(struct interpreter *, void *)' scope.c:1543:13: runtime error: call to function S_unwind_handler_stack through pointer to incorrect function type 'void (*)(struct interpreter *, void *)'
1 parent 5599d91 commit 5e6221d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

embed.fnc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4825,13 +4825,13 @@ S |SV * |magic_methcall1|NN SV *sv \
48254825
S |int |magic_methpack |NN SV *sv \
48264826
|NN const MAGIC *mg \
48274827
|NN SV *meth
4828-
S |void |restore_magic |NULLOK const void *p
4828+
S |void |restore_magic |NULLOK void *p
48294829
S |void |save_magic_flags \
48304830
|SSize_t mgs_ix \
48314831
|NN SV *sv \
48324832
|U32 flags
48334833
S |void |unwind_handler_stack \
4834-
|NULLOK const void *p
4834+
|NULLOK void *p
48354835
#endif
48364836
#if defined(PERL_IN_MG_C) || defined(PERL_IN_PP_C)
48374837
Tp |bool |translate_substr_offsets \

mg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3824,7 +3824,7 @@ Perl_perly_sighandler(int sig, Siginfo_t *sip PERL_UNUSED_DECL,
38243824

38253825

38263826
static void
3827-
S_restore_magic(pTHX_ const void *p)
3827+
S_restore_magic(pTHX_ void *p)
38283828
{
38293829
MGS* const mgs = SSPTR(PTR2IV(p), MGS*);
38303830
SV* const sv = mgs->mgs_sv;
@@ -3881,7 +3881,7 @@ S_restore_magic(pTHX_ const void *p)
38813881
* skipped over. */
38823882

38833883
static void
3884-
S_unwind_handler_stack(pTHX_ const void *p)
3884+
S_unwind_handler_stack(pTHX_ void *p)
38853885
{
38863886
PERL_UNUSED_ARG(p);
38873887

proto.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)