'This' pointer was not passed to vm_call_method_this_a() in args which caused a SIGSEGV inside that function.
Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- vm/call.c | 1 + vm/reflection.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vm/call.c b/vm/call.c index a33e6a7..cc2f84d 100644 --- a/vm/call.c +++ b/vm/call.c @@ -83,6 +83,7 @@ unsigned long vm_call_method_this_a(struct vm_method *method, void *target; target = this->class->vtable.native_ptr[method->virtual_index]; + assert(args != NULL); assert(args[0] == (unsigned long) this); return call_method_a(method, target, args); diff --git a/vm/reflection.c b/vm/reflection.c index 5ce258d..c7fc9e5 100644 --- a/vm/reflection.c +++ b/vm/reflection.c @@ -627,6 +627,8 @@ jint native_field_get_modifiers_internal(struct vm_object *this) static int unwrap_and_set_field(void *field_ptr, enum vm_type type, struct vm_object *value) { + unsigned long args[] = { (unsigned long) value }; + switch (type) { case J_REFERENCE: *(jobject *) field_ptr = value; @@ -641,11 +643,11 @@ static int unwrap_and_set_field(void *field_ptr, enum vm_type type, * returned by ireturn anyway. */ *(long *) field_ptr = vm_call_method_this_a(vm_java_lang_Number_intValue, - value, NULL); + value, args); return 0; case J_FLOAT: *(jfloat *) field_ptr = (jfloat) vm_call_method_this_a(vm_java_lang_Number_floatValue, - value, NULL); + value, args); return 0; case J_LONG: case J_DOUBLE: -- 1.6.0.4 ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel