* Removed all Id tags.
[cacao.git] / src / vm / access.c
index 70acfc38e9d2b567b41f3f0f916d4ca7913d13ca..c8d1b68fb8779d6ffb7f9c0a35780774f31fa2d7 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: access.c 8237 2007-07-27 16:15:29Z twisti $
-
 */
 
 
@@ -36,6 +34,8 @@
 
 #include "mm/memory.h"
 
+#include "native/llni.h"
+
 #include "vm/access.h"
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
 #include "vmcore/method.h"
 
 
-/****************************************************************************/
-/* ACCESS CHECKS                                                            */
-/****************************************************************************/
-
 /* access_is_accessible_class **************************************************
  
    Check if a class is accessible from another class
@@ -95,7 +91,7 @@ bool access_is_accessible_class(classinfo *referer, classinfo *cls)
        /* NOTE: This check must be before checks that could return
           false. */
 
-       if (class_issubclass(cls, class_sun_reflect_MagicAccessorImpl))
+       if (class_issubclass(referer, class_sun_reflect_MagicAccessorImpl))
                return true;
 #endif
 
@@ -150,7 +146,7 @@ bool access_is_accessible_member(classinfo *referer, classinfo *declarer,
        /* NOTE: This check must be before checks that could return
           false. */
 
-       if (class_issubclass(declarer, class_sun_reflect_MagicAccessorImpl))
+       if (class_issubclass(referer, class_sun_reflect_MagicAccessorImpl))
                return true;
 #endif
 
@@ -213,11 +209,11 @@ bool access_is_accessible_member(classinfo *referer, classinfo *declarer,
 
 bool access_check_field(fieldinfo *f, s4 calldepth)
 {
-       java_objectarray *oa;
-       classinfo        *callerclass;
-       char             *msg;
-       s4                msglen;
-       utf              *u;
+       java_handle_objectarray_t *oa;
+       classinfo                 *callerclass;
+       char                      *msg;
+       s4                         msglen;
+       utf                       *u;
 
        /* if everything is public, there is nothing to check */
 
@@ -231,7 +227,7 @@ bool access_check_field(fieldinfo *f, s4 calldepth)
        if (oa == NULL)
                return false;
 
-       assert(calldepth >= 0 && calldepth < oa->header.size);
+       assert(calldepth >= 0 && calldepth < LLNI_array_size(oa));
 
        callerclass = (classinfo *) oa->data[calldepth];
 
@@ -294,11 +290,11 @@ bool access_check_field(fieldinfo *f, s4 calldepth)
 
 bool access_check_method(methodinfo *m, s4 calldepth)
 {
-       java_objectarray *oa;
-       classinfo        *callerclass;
-       char             *msg;
-       s4                msglen;
-       utf              *u;
+       java_handle_objectarray_t *oa;
+       classinfo                 *callerclass;
+       char                      *msg;
+       s4                         msglen;
+       utf                       *u;
 
        /* if everything is public, there is nothing to check */
 
@@ -312,7 +308,7 @@ bool access_check_method(methodinfo *m, s4 calldepth)
        if (oa == NULL)
                return false;
 
-       assert(calldepth >= 0 && calldepth < oa->header.size);
+       assert(calldepth >= 0 && calldepth < LLNI_array_size(oa));
 
        callerclass = (classinfo *) oa->data[calldepth];