diff options
author | Tomasz Konojacki <me@xenu.pl> | 2019-10-29 16:31:19 +0100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-10-30 15:11:55 +1100 |
commit | d398c6bff9ffeadd64017079aea6fd0967884bf4 (patch) | |
tree | d7c590f5e81826446f28259a4f93a991d66bc6ea /pp.c | |
parent | 3f2416aea024cc4d3e0b0ffbe0e292a0d9970b8d (diff) | |
download | perl-d398c6bff9ffeadd64017079aea6fd0967884bf4.tar.gz |
use PTR2nat() instead of casting pointers to unsigned long
Casting a pointer to unsigned long will result in truncation when
sizeof(void*) > sizeof(unsigned long)
[gh #17232]
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2552,7 +2552,7 @@ S_scomplement(pTHX_ SV *targ, SV *sv) #ifdef LIBERAL { long *tmpl; - for ( ; anum && (unsigned long)tmps % sizeof(long); anum--, tmps++) + for ( ; anum && PTR2nat(tmps) % sizeof(long); anum--, tmps++) *tmps = ~*tmps; tmpl = (long*)tmps; for ( ; anum >= (I32)sizeof(long); anum -= (I32)sizeof(long), tmpl++) |