This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
IRIX long-double sqrt(2) one bit error in the least significant end.
[perl5.git] / handy.h
diff --git a/handy.h b/handy.h
index 6691e3f..ffb8e2f 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -965,10 +965,11 @@ patched there.  The file as of this writing is cpan/Devel-PPPort/parts/inc/misc
 
 /* This next group is only used on EBCDIC platforms, so theoretically could be
  * shared with something entirely different that's only on ASCII platforms */
-#  define _CC_UTF8_IS_START                 29
-#  define _CC_UTF8_IS_DOWNGRADEABLE_START   30
-#  define _CC_UTF8_IS_CONTINUATION          31
-/* Unused: 24-28
+#  define _CC_UTF8_START_BYTE_IS_FOR_AT_LEAST_SURROGATE 28
+#  define _CC_UTF8_IS_START                             29
+#  define _CC_UTF8_IS_DOWNGRADEABLE_START               30
+#  define _CC_UTF8_IS_CONTINUATION                      31
+/* Unused: 24-27
  * If more bits are needed, one could add a second word for non-64bit
  * QUAD_IS_INT systems, using some #ifdefs to distinguish between having a 2nd
  * word or not.  The IS_IN_SOME_FOLD bit is the most easily expendable, as it
@@ -1916,10 +1917,13 @@ PoisonWith(0xEF) for catching access to freed memory.
  * As well as avoiding the need for a run-time check in some cases, it's
  * designed to avoid compiler warnings like:
  *     comparison is always false due to limited range of data type
+ * It's mathematically equivalent to
+ *    max(n) * sizeof(t) > MEM_SIZE_MAX
  */
 
 #  define _MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) \
-    (sizeof(t) > ((MEM_SIZE)1 << 8*(sizeof(MEM_SIZE) - sizeof(n))))
+    (  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