We should use jdouble and jfloat, or otherwise there will
be implicit argument conversion from uint64_t to double
when array_get_field_double() will be called in
vm_jni_release_double_array_elements() with jdouble
argument.

This bug caused that 
gnu/java/awt/peer/gtk/FreetypeGlyphVector.getMetricsNative(IJ)[D
was returning corrupted array.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 include/vm/object.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/vm/object.h b/include/vm/object.h
index d4d68c9..e707d35 100644
--- a/include/vm/object.h
+++ b/include/vm/object.h
@@ -204,22 +204,22 @@ array_set_field_float(struct vm_object *obj, int index, 
jfloat value)
        *(jfloat *) &obj->fields[index * get_vmtype_size(J_FLOAT)] = value;
 }
 
-static inline float
+static inline jfloat
 array_get_field_float(struct vm_object *obj, int index)
 {
-       return *(float *) &obj->fields[index * get_vmtype_size(J_FLOAT)];
+       return *(jfloat *) &obj->fields[index * get_vmtype_size(J_FLOAT)];
 }
 
 static inline void
-array_set_field_double(struct vm_object *obj, int index, double value)
+array_set_field_double(struct vm_object *obj, int index, jdouble value)
 {
-       *(double *) &obj->fields[index * get_vmtype_size(J_DOUBLE)] = value;
+       *(jdouble *) &obj->fields[index * get_vmtype_size(J_DOUBLE)] = value;
 }
 
-static inline double
+static inline jdouble
 array_get_field_double(struct vm_object *obj, int index)
 {
-       return *(double *) &obj->fields[index * get_vmtype_size(J_DOUBLE)];
+       return *(jdouble *) &obj->fields[index * get_vmtype_size(J_DOUBLE)];
 }
 
 static inline void
-- 
1.6.0.6


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to