Fix in native _java_lang_ClassLoader_defineClass1:_:_:_:_:_:_: development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 29 Mar 2013 19:45:08 +0000
branchdevelopment
changeset 2473 dd4b4b6e9cfb
parent 2472 226437481a47
child 2475 27f0940ec023
Fix in native _java_lang_ClassLoader_defineClass1:_:_:_:_:_:_: Check class's real class name - do no depend on passed class name for it can be null or may not match the real class name.
JavaNativeMethodImpl_OpenJDK6.st
--- a/JavaNativeMethodImpl_OpenJDK6.st	Fri Mar 29 16:38:17 2013 +0000
+++ b/JavaNativeMethodImpl_OpenJDK6.st	Fri Mar 29 19:45:08 2013 +0000
@@ -9152,12 +9152,6 @@
 
     | className  b  off  len  pd bs  cls |
     className := Java as_ST_String: a1.
-    "if name starts with java.* or package is signed by something else and we are not signed, throw security exception"
-    "ClassLoadersTest>>testEyeOpeningClassLoaderLoadObject"
-    "18.11. mh revised - they really test it against java., totally ignoring boot class path.. That surpsised me"
-    (className startsWith: 'java.') ifTrue: [
-        JavaVM throwSecurityExceptionWith:'className=' , className
-    ].
     cls := nil.
     b := a2.
     b isNil ifTrue: [JavaVM throwNullPointerException].
@@ -9175,6 +9169,12 @@
         JavaVM throwClassFormatError:ex description.
         ^ nil.
     ].
+    "if name starts with java.* or package is signed by something else and we are not signed, throw security exception"
+    "ClassLoadersTest>>testEyeOpeningClassLoaderLoadObject"
+    "18.11. mh revised - they really test it against java., totally ignoring boot class path.. That surpsised me"
+    (cls name startsWith: 'java/') ifTrue: [
+        JavaVM throwSecurityExceptionWith:'className=' , cls name
+    ].
     self assert: cls classLoader == this.
      "FIXME: What to do with source?"
     ClassRegistry registerClass: cls.
@@ -9184,7 +9184,7 @@
 
     "Modified: / 08-12-2011 / 20:56:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
     "Modified: / 10-09-2012 / 22:21:22 / m"
-    "Modified: / 08-02-2013 / 13:09:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 29-03-2013 / 19:25:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 _java_lang_ClassLoader_defineClass2: this _: a1 _: a2 _: a3 _: a4 _: a5