In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/445198b9b50e1018da1c98005a88bdf15c964f23?hp=2b8b74b0774fa605da54cf36ca3be953a4ef9703>
- Log ----------------------------------------------------------------- commit 445198b9b50e1018da1c98005a88bdf15c964f23 Author: Lukas Mai <l....@web.de> Date: Sat Nov 11 13:35:13 2017 +0100 Revert "Simplify _MEM_WRAP_NEEDS_RUNTIME_CHECK()" This reverts commit 004073bac990d90244eb463f435c52d4040b36df. commit b7112dce7ec5b90ace89fcf4598b0be8168fea82 Author: Lukas Mai <l....@web.de> Date: Sat Nov 11 13:34:20 2017 +0100 fix MEM_SIZE_MAX definition ----------------------------------------------------------------------- Summary of changes: handy.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handy.h b/handy.h index f75c900656..77415ecb45 100644 --- a/handy.h +++ b/handy.h @@ -2295,7 +2295,7 @@ PoisonWith(0xEF) for catching access to freed memory. #define NEWSV(x,len) newSV(len) #endif -#define MEM_SIZE_MAX ((MEM_SIZE)~0) +#define MEM_SIZE_MAX ((MEM_SIZE)-1) #define _PERL_STRLEN_ROUNDUP_UNCHECKED(n) (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1)) @@ -2312,7 +2312,8 @@ PoisonWith(0xEF) for catching access to freed memory. */ # define _MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) \ - (8 * sizeof(n) + sizeof(t) > sizeof(MEM_SIZE)) + ( sizeof(MEM_SIZE) < sizeof(n) \ + || sizeof(t) > ((MEM_SIZE)1 << 8*(sizeof(MEM_SIZE) - sizeof(n)))) /* This is written in a slightly odd way to avoid various spurious * compiler warnings. We *want* to write the expression as -- Perl5 Master Repository