2009/7/1 Tomek Grabiec <tgrab...@gmail.com>:
>
> Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
> ---
>  vm/object.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/vm/object.c b/vm/object.c
> index 26b1f76..aaf4606 100644
> --- a/vm/object.c
> +++ b/vm/object.c
> @@ -14,6 +14,7 @@
>  #include <vm/object.h>
>  #include <vm/stdlib.h>
>  #include <vm/string.h>
> +#include <vm/types.h>
>  #include <vm/utf8.h>
>
>  struct vm_object *vm_object_alloc(struct vm_class *class)
> @@ -42,9 +43,12 @@ struct vm_object *vm_object_alloc(struct vm_class *class)
>  struct vm_object *vm_object_alloc_native_array(int type, int count)
>  {
>        struct vm_object *res;
> +       int vm_type;
>
> -       /* XXX: Use the right size... */
> -       res = zalloc(sizeof(*res) + 8 * count);
> +       vm_type = bytecode_type_to_vmtype(type);
> +       assert(vm_type != 0);

I would put an explicit J_VOID here instead of 0. Looking at
vm/types.h, it seems that we should also prohibit J_RETURN_ADDRESS
(though I think that's much less likely to happen in practice).

Otherwise,

Acked-by: Vegard Nossum <vegard.nos...@gmail.com>


Vegard

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

Reply via email to