one additional condition which should throw an array index out of bounds, instead...
authorjowenn <none@none>
Sun, 19 Dec 2004 17:39:01 +0000 (17:39 +0000)
committerjowenn <none@none>
Sun, 19 Dec 2004 17:39:01 +0000 (17:39 +0000)
TODO
src/native/vm/VMClassLoader.c
src/native/vm/VMSecurityManager.c
src/native/vm/VMSystem.c
tests/native/Makefile.am
tests/native/testgetobjectclass0.c [new file with mode: 0644]
tests/native/testgetobjectclass0.java [new file with mode: 0644]

diff --git a/TODO b/TODO
index ad87f99f6a41c73a4d1ca5d2424a08691264e062..caf1a2796a7ec3fe6dc506944f9a4c15a5e736d0 100644 (file)
--- a/TODO
+++ b/TODO
@@ -139,3 +139,23 @@ Description: Check ARCH-CHANGES.
 Assigned   : ALL
 Status     : OPEN
 Comments   :
+
+Description: classloader namespacing and unloading of native libraries (btw: jdk 1.2+ instead of jdk 1.1 compliant behaviour)
+Assigned   : jowenn
+Status     : OPEN
+Comments   :
+
+Description: Fix exception stacktraces containing Alpha-leaf methods
+Assigned   : jowenn
+Status     : OPEN
+Comments   :
+
+Description: solve the problem that jython calles methods with double parameters wrongly in cacao
+Assigned   : jowenn
+Status     : OPEN
+Comments   :
+
+Description: Implement JavaVM interface and releated functions to make cacao embeddable
+Assigned   : jowenn, all
+Status     : OPEN
+Comments   :
index a7086c43ac445e0163251aee8941839724166f67..bae92d10f44a8b7f90ea8244bf0d3e004c21c561 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger
 
-   $Id: VMClassLoader.c 1735 2004-12-07 14:33:27Z twisti $
+   $Id: VMClassLoader.c 1773 2004-12-19 17:39:01Z jowenn $
 
 */
 
@@ -54,7 +54,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_defineClass(JNIE
 {
        classinfo *c;
 
-       log_text("Java_java_lang_VMClassLoader_defineClass called");
+       /*log_text("Java_java_lang_VMClassLoader_defineClass called");*/
 
        if (off < 0 || len < 0 || off + len > buf->header.size) {
                *exceptionptr =
index ed7a98f3169e867780e2654b17855bd982a9c094..0512f51d1a9cc10395ab35b2c2474861fd671591 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger
 
-   $Id: VMSecurityManager.c 1735 2004-12-07 14:33:27Z twisti $
+   $Id: VMSecurityManager.c 1773 2004-12-19 17:39:01Z jowenn $
 
 */
 
@@ -49,7 +49,7 @@
  */
 JNIEXPORT java_lang_ClassLoader* JNICALL Java_java_lang_VMSecurityManager_currentClassLoader(JNIEnv *env, jclass clazz)
 {
-       log_text("Java_java_lang_VMSecurityManager_currentClassLoader");
+       /*log_text("Java_java_lang_VMSecurityManager_currentClassLoader");*/
 
        if (cacao_initializing)
                return NULL;
@@ -72,7 +72,7 @@ JNIEXPORT java_lang_ClassLoader* JNICALL Java_java_lang_VMSecurityManager_curren
  */
 JNIEXPORT java_objectarray* JNICALL Java_java_lang_VMSecurityManager_getClassContext(JNIEnv *env, jclass clazz)
 {
-       log_text("Java_java_lang_VMSecurityManager_getClassContext  called");
+       /*log_text("Java_java_lang_VMSecurityManager_getClassContext  called");*/
        if (cacao_initializing) return 0;
 #if defined(__I386__) || defined(__ALPHA__)
        return cacao_createClassContextArray();
index aead797c191892bd173479430b4627a163d38ecf..cb62e12f964247d63b0e9e6dc56a01ffc387b287 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger
 
-   $Id: VMSystem.c 1735 2004-12-07 14:33:27Z twisti $
+   $Id: VMSystem.c 1773 2004-12-19 17:39:01Z jowenn $
 
 */
 
@@ -73,7 +73,7 @@ JNIEXPORT void JNICALL Java_java_lang_VMSystem_arraycopy(JNIEnv *env, jclass cla
                return; 
        }
 
-       if ((len < 0) || (sp < 0) || (sp + len > s->size) || (dp < 0) || (dp + len > d->size)) {
+       if ((len < 0) || (sp < 0) || (sp + len > s->size) || (dp < 0) || (dp + len > d->size) || (dp+len<0)) {
                *exceptionptr = new_exception(string_java_lang_ArrayIndexOutOfBoundsException);
                return; 
        }
index 54e4e681a0312f3b02cbc514aa980c9ed004b37a..a0435352614d9f5b93ebd98a6c3bef51c5644d63 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## Changes:
 ##
-## $Id: Makefile.am 1756 2004-12-13 10:09:35Z twisti $
+## $Id: Makefile.am 1773 2004-12-19 17:39:01Z jowenn $
 
 ## Process this file with automake to produce Makefile.in
 
@@ -47,6 +47,9 @@ all:
        $(CACAOC) testarguments.java
        $(CACAOH) testarguments
        $(CC) -shared $(INCLUDES) $(CFLAGS) testarguments.c -o libtestarguments.so -fPIC
+       $(CACAOC) testgetobjectclass0.java
+       $(CACAOH) testgetobjectclass0
+       $(CC) -shared $(INCLUDES) $(CFLAGS) testgetobjectclass0.c -o libtestgetobjectclass0.so -fPIC
 
 
 ## Local variables:
diff --git a/tests/native/testgetobjectclass0.c b/tests/native/testgetobjectclass0.c
new file mode 100644 (file)
index 0000000..8d29133
--- /dev/null
@@ -0,0 +1,41 @@
+/* tests/native/testgetobjectclass0.c - tests argument passing
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Joseph Wenninger
+
+   $Id: testgetobjectclass0.c 1773 2004-12-19 17:39:01Z jowenn $
+
+*/
+
+
+#include "config.h"
+#include "native/jni.h"
+
+
+JNIEXPORT void JNICALL Java_testgetobjectclass0_getobjectclass0(JNIEnv *env, jclass clazz)
+{
+    (*env)->GetObjectClass(env,0);
+}
diff --git a/tests/native/testgetobjectclass0.java b/tests/native/testgetobjectclass0.java
new file mode 100644 (file)
index 0000000..32e70d5
--- /dev/null
@@ -0,0 +1,42 @@
+/* tests/native/testgetobjectclass0.java - tests argument passing
+
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   TU Wien
+
+   This file is part of CACAO.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+
+   Contact: cacao@complang.tuwien.ac.at
+
+   Authors: Joseph Wenninger
+
+   $Id: testgetobjectclass0.java 1773 2004-12-19 17:39:01Z jowenn $
+
+*/
+
+
+public class  testgetobjectclass0{
+
+    public static native void getobjectclass0();
+
+    public static void main(String[] args) {
+        System.loadLibrary("testgetobjectclass0");
+        getobjectclass0();
+    }
+}