This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
For ptr masking use PTRSIZE-1, not nested conditional statement.
[perl5.git] / perl.c
diff --git a/perl.c b/perl.c
index 27d0d9e..1b9b429 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -1496,8 +1496,7 @@ perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char **argv, char **env)
         * --jhi */
         const char *s = NULL;
         int i;
-        const UV mask =
-          ~(UV)(PTRSIZE == 4 ? 3 : PTRSIZE == 8 ? 7 : PTRSIZE == 16 ? 15 : 0);
+        const UV mask = ~(UV)(PTRSIZE-1);
          /* Do the mask check only if the args seem like aligned. */
         const UV aligned =
           (mask < ~(UV)0) && ((PTR2UV(argv[0]) & mask) == PTR2UV(argv[0]));