Reported-by: Arthur HUILLET <arthur.huil...@free.fr>
Signed-off-by: Vegard Nossum <vegard.nos...@gmail.com>
---
 include/vm/class.h |    5 +++++
 vm/class.c         |    4 +++-
 vm/itable.c        |    5 +----
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/include/vm/class.h b/include/vm/class.h
index 4333f4a..e6cb2fe 100644
--- a/include/vm/class.h
+++ b/include/vm/class.h
@@ -85,6 +85,11 @@ static inline bool vm_class_is_interface(const struct 
vm_class *vmc)
        return vmc->class->access_flags & CAFEBABE_CLASS_ACC_INTERFACE;
 }
 
+static inline bool vm_class_is_abstract(const struct vm_class *vmc)
+{
+       return vmc->class->access_flags & CAFEBABE_CLASS_ACC_ABSTRACT;
+}
+
 static inline bool vm_class_is_array_class(const struct vm_class *vmc)
 {
        return vmc->kind == VM_CLASS_KIND_ARRAY;
diff --git a/vm/class.c b/vm/class.c
index c153fe4..5382377 100644
--- a/vm/class.c
+++ b/vm/class.c
@@ -304,7 +304,9 @@ int vm_class_link(struct vm_class *vmc, const struct 
cafebabe_class *class)
 
        if (!vm_class_is_interface(vmc)) {
                setup_vtable(vmc);
-               vm_itable_setup(vmc);
+
+               if (!vm_class_is_abstract(vmc))
+                       vm_itable_setup(vmc);
        }
 
        INIT_LIST_HEAD(&vmc->static_fixup_site_list);
diff --git a/vm/itable.c b/vm/itable.c
index a705ddb..dcfc08d 100644
--- a/vm/itable.c
+++ b/vm/itable.c
@@ -224,10 +224,7 @@ int vm_itable_setup(struct vm_class *vmc)
                        struct vm_method *c_vmm
                                = vm_class_get_method_recursive(vmc,
                                        i_vmm->name, i_vmm->type);
-                       if (!c_vmm) {
-                               NOT_IMPLEMENTED;
-                               continue;
-                       }
+                       assert(c_vmm);
 
                        entry->c_method = c_vmm;
                }
-- 
1.6.0.4


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to