OSDN Git Service

Add class checks in AllocObject / NewObject.
authorAndy McFadden <fadden@android.com>
Mon, 19 Jul 2010 22:44:56 +0000 (15:44 -0700)
committerAndy McFadden <fadden@android.com>
Tue, 20 Jul 2010 17:41:40 +0000 (10:41 -0700)
commitb76594d71daec00e5947a5f6f14282f8f9edebe4
tree5259ee71af9787a8c46c040b712423bf86aab1f1
parent4ab3f7540e6d4f344f244e4bae2e08895d1e6e92
Add class checks in AllocObject / NewObject.

The JNI spec says the functions throw InstantiationException if you
pass in an abstract or interface class, and that you "must not" try to
allocate an array class with this mechanism.  These are now checked.
We also forbid creation of a Class object with these calls, since
that should only be done by DefineClass.

Also, added appropriate "is class initialized" code for the A/V
variants of NewObject, which were strangely lacking them.

Change-Id: I8dde7a812265cfb16b1765695c652e98c9de0840
vm/Jni.c