mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
fix type of S_clear_yystack()
Functions registered with SAVEDESTRUCTOR_X must be of type
'void (pTHX_ void *)' because that's how scope.c stores and calls them.
Should fix this ASan error:
scope.c:1537:13: runtime error: call to function S_clear_yystack through pointer to incorrect function type 'void (*)(struct interpreter *, void *)'
This commit is contained in:
parent
d4c1434052
commit
c5ead5da7b
7
perly.c
7
perly.c
@ -220,9 +220,12 @@ do { \
|
||||
* parse stack, thus avoiding leaks if we die */
|
||||
|
||||
static void
|
||||
S_clear_yystack(pTHX_ const yy_parser *parser)
|
||||
S_clear_yystack(pTHX_ void *arg)
|
||||
{
|
||||
yy_stack_frame *ps = parser->ps;
|
||||
/* arg must be void * for this function to be compatible with
|
||||
SAVEDESTRUCTOR_X/any_dxptr */
|
||||
const yy_parser *parser = (const yy_parser *)arg;
|
||||
yy_stack_frame *ps = parser->ps;
|
||||
int i = 0;
|
||||
|
||||
if (!parser->stack)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user