Signed-off-by: Tomek Grabiec <[email protected]>
---
 vm/object.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/vm/object.c b/vm/object.c
index 0f96e62..b5b1afc 100644
--- a/vm/object.c
+++ b/vm/object.c
@@ -317,22 +317,24 @@ void vm_object_check_array(struct vm_object *obj, 
unsigned int index)
 
 void array_store_check(struct vm_object *arrayref, struct vm_object *obj)
 {
-       NOT_IMPLEMENTED;
-
-#if 0
-       struct vm_class *cb;
+       struct vm_class *class;
+       struct vm_class *element_class;
        struct string *str;
        int err;
 
-       cb = arrayref->class;
+       if (obj == NULL)
+               return;
+
+       class = arrayref->class;
 
-       if (!IS_ARRAY(cb)) {
+       if (!vm_class_is_array_class(class)) {
                signal_new_exception("java/lang/RuntimeException",
                                     "object is not an array");
                goto throw;
        }
 
-       if (obj == NULL || isInstanceOf(cb->element_class, obj->class))
+       element_class = vm_class_get_array_element_class(class);
+       if (vm_class_is_assignable_from(element_class, obj->class))
                return;
 
        str = alloc_str();
@@ -360,7 +362,6 @@ void array_store_check(struct vm_object *arrayref, struct 
vm_object *obj)
                die("%s: out of memory", __func__);
 
        die("%s: error %d", __func__, err);
-#endif
 }
 
 void array_store_check_vmtype(struct vm_object *arrayref, enum vm_type vm_type)
-- 
1.6.0.6


------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to