Skip to content

Commit 7afcfcc

Browse files
committed
POSIX: fix type of restore_sigmask
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 restore_sigmask through pointer to incorrect function type 'void (*)(struct interpreter *, void *)' (Also, change indentation from 5 to 4 spaces.)
1 parent 0b23ab5 commit 7afcfcc

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

ext/POSIX/POSIX.xs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,16 +1629,17 @@ not_here(const char *s)
16291629
#include "const-c.inc"
16301630

16311631
static void
1632-
restore_sigmask(pTHX_ SV *osset_sv)
1632+
restore_sigmask(pTHX_ void *ptr)
16331633
{
1634-
/* Fortunately, restoring the signal mask can't fail, because
1635-
* there's nothing we can do about it if it does -- we're not
1636-
* supposed to return -1 from sigaction unless the disposition
1637-
* was unaffected.
1638-
*/
1634+
/* Fortunately, restoring the signal mask can't fail, because
1635+
* there's nothing we can do about it if it does -- we're not
1636+
* supposed to return -1 from sigaction unless the disposition
1637+
* was unaffected.
1638+
*/
16391639
#if !(defined(__amigaos4__) && defined(__NEWLIB__))
1640-
sigset_t *ossetp = (sigset_t *) SvPV_nolen( osset_sv );
1641-
(void)sigprocmask(SIG_SETMASK, ossetp, (sigset_t *)0);
1640+
SV *osset_sv = (SV *)ptr;
1641+
sigset_t *ossetp = (sigset_t *) SvPV_nolen( osset_sv );
1642+
(void)sigprocmask(SIG_SETMASK, ossetp, (sigset_t *)0);
16421643
#endif
16431644
}
16441645

ext/POSIX/lib/POSIX.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use warnings;
44

55
our ($AUTOLOAD, %SIGRT);
66

7-
our $VERSION = '2.23';
7+
our $VERSION = '2.24';
88

99
require XSLoader;
1010

0 commit comments

Comments
 (0)