7044285: 64 bit VM crashes in Java_sun_java2d_loops_MaskFill_MaskFill
authorbae
Wed, 20 Jul 2011 16:18:08 +0400
changeset 10086 a6dbbf4eb30f
parent 10085 7f82305d48d1
child 10087 e1bbe4597795
7044285: 64 bit VM crashes in Java_sun_java2d_loops_MaskFill_MaskFill Reviewed-by: jgodinez, prr
jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h
--- a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h	Tue Jul 19 14:09:25 2011 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h	Wed Jul 20 16:18:08 2011 +0400
@@ -30,6 +30,8 @@
 extern "C" {
 #endif
 
+#include <stddef.h>
+
 #include "java_awt_AlphaComposite.h"
 
 #include "SurfaceData.h"
@@ -484,7 +486,9 @@
 #define ArraySize(A)    (sizeof(A) / sizeof(A[0]))
 
 #define PtrAddBytes(p, b)               ((void *) (((intptr_t) (p)) + (b)))
-#define PtrCoord(p, x, xinc, y, yinc)   PtrAddBytes(p, (y)*(yinc) + (x)*(xinc))
+#define PtrCoord(p, x, xinc, y, yinc)   PtrAddBytes(p, \
+                                                    ((ptrdiff_t)(y))*(yinc) + \
+                                                    ((ptrdiff_t)(x))*(xinc))
 
 /*
  * The function to call with an array of NativePrimitive structures