On Sun, 2009-07-05 at 22:36 +0200, Tomek Grabiec wrote:
> Add missing return after throw_from_native() and put object->class check in 
> assertion
> 
> Reported-by: Vegard Nossum <vegard.nos...@gmail.com>
> Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>

I applied this but here are some comments:

> ---
>  vm/jato.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/vm/jato.c b/vm/jato.c
> index e28e808..c18ddd9 100644
> --- a/vm/jato.c
> +++ b/vm/jato.c
> @@ -272,11 +272,14 @@ native_vmobject_clone(struct vm_object *object)
>  static struct vm_object * __vm_native
>  native_vmobject_getclass(struct vm_object *object)
>  {
> -     if (!object || !object->class) {
> +     if (!object) {
>               signal_new_exception(vm_java_lang_NullPointerException, NULL);
>               throw_from_native(sizeof object);
> +             return NULL;

We never return throw_from_native(), do we? Can we use "__attribute__
((noreturn))" here and drop the return NULL?

>       }
>  
> +     assert(object->class);
> +

This should probably use error() instead.

>       return object->class->object;
>  }
>  


------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to