[kaffe] CVS kaffe (guilhem): Fixed pointer arithmetic in jni unveil.

Kaffe CVS cvs-commits at kaffe.org
Tue Jul 5 10:43:46 PDT 2005


PatchSet 6699 
Date: 2005/07/05 17:35:06
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixed pointer arithmetic in jni unveil.

Members: 
	ChangeLog:1.4223->1.4224 
	kaffe/kaffevm/jni/jni_i.h:1.9->1.10 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4223 kaffe/ChangeLog:1.4224
--- kaffe/ChangeLog:1.4223	Tue Jul  5 17:20:35 2005
+++ kaffe/ChangeLog	Tue Jul  5 17:35:06 2005
@@ -1,5 +1,10 @@
 2005-07-05  Guilhem Lavaux  <guilhem at kaffe.org>
 
+	* kaffe/kaffevm/jni/jni_i.h
+	(unveil): Fixed pointer arithmetic.
+
+2005-07-05  Guilhem Lavaux  <guilhem at kaffe.org>
+
 	* WHATSNEW: Added changes to JNI interface.
 
 	* kaffe/kaffevm/gc.h,
Index: kaffe/kaffe/kaffevm/jni/jni_i.h
diff -u kaffe/kaffe/kaffevm/jni/jni_i.h:1.9 kaffe/kaffe/kaffevm/jni/jni_i.h:1.10
--- kaffe/kaffe/kaffevm/jni/jni_i.h:1.9	Tue Jul  5 17:20:41 2005
+++ kaffe/kaffe/kaffevm/jni/jni_i.h	Tue Jul  5 17:35:12 2005
@@ -26,7 +26,9 @@
 static inline jobject
 unveil(jref w)
 {
-  return ( (((uintp)w) & 1) ? *((jobject *)w) : w);
+  uintp wp = (uintp) w;
+
+  return ( (wp & 1) ? *((jobject *)(wp & ~(uintp)1)) : w);
 }
 
 /*



More information about the kaffe mailing list