]> granicus.if.org Git - php/commitdiff
fix pointer truncation cases
authorAnatol Belski <ab@php.net>
Sat, 15 Aug 2015 09:26:20 +0000 (11:26 +0200)
committerAnatol Belski <ab@php.net>
Sat, 15 Aug 2015 09:27:07 +0000 (11:27 +0200)
ext/mbstring/oniguruma/regint.h

index 0fba09bb584b0d5b99ca2cdcbff015fc555af16a..7ab233aeb4ab11fa066dd216b56e9852a3956243 100644 (file)
 } while(0)
 
 /* sizeof(OnigCodePoint) */
-#define WORD_ALIGNMENT_SIZE     SIZEOF_LONG
+#define WORD_ALIGNMENT_SIZE     SIZEOF_SIZE_T
 
 #define GET_ALIGNMENT_PAD_SIZE(addr,pad_size) do {\
   (pad_size) = WORD_ALIGNMENT_SIZE \
-               - ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\
+               - ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\
   if ((pad_size) == WORD_ALIGNMENT_SIZE) (pad_size) = 0;\
 } while (0)
 
 #define ALIGNMENT_RIGHT(addr) do {\
   (addr) += (WORD_ALIGNMENT_SIZE - 1);\
-  (addr) -= ((unsigned int )(addr) % WORD_ALIGNMENT_SIZE);\
+  (addr) -= ((size_t)(addr) % WORD_ALIGNMENT_SIZE);\
 } while (0)
 
 #endif /* PLATFORM_UNALIGNED_WORD_ACCESS */
@@ -688,7 +688,11 @@ typedef struct {
   BBuf*  mbuf;   /* multi-byte info or NULL */
 } CClassNode;
 
+#ifdef _WIN64
+typedef __int64 OnigStackIndex;
+#else
 typedef long OnigStackIndex;
+#endif
 
 typedef struct _OnigStackType {
   unsigned int type;