Commit d2f346cc authored by Evan W. Patton's avatar Evan W. Patton

Fix crash of static field reuse in tests

Change-Id: I3590ed72a5ea0af41cf575b8237f66489de047b9
parent 6bc7b61d
...@@ -747,6 +747,11 @@ yail_invoke(pic_state *pic) { ...@@ -747,6 +747,11 @@ yail_invoke(pic_state *pic) {
NSMutableArray *argTypes = [NSMutableArray arrayWithCapacity:argc]; NSMutableArray *argTypes = [NSMutableArray arrayWithCapacity:argc];
SCMMethod *method = nil; SCMMethod *method = nil;
if (pic_sym_p(pic, native_object)) {
// Convert the symbol to the class/protocol/instance it names
yail_resolve_native_symbol(pic, native_object);
native_object = pic_weak_ref(pic, pic->globals, native_object);
}
int isStatic = yail_native_class_p(pic, native_object) ? 1 : 0; int isStatic = yail_native_class_p(pic, native_object) ? 1 : 0;
if (yail_native_method_p(pic, native_method)) { if (yail_native_method_p(pic, native_method)) {
method = yail_native_method_ptr(pic, native_method)->method_; method = yail_native_method_ptr(pic, native_method)->method_;
...@@ -1471,7 +1476,7 @@ yail_static_field(pic_state *pic) { ...@@ -1471,7 +1476,7 @@ yail_static_field(pic_state *pic) {
NSInvocation *invocation = [method staticInvocation]; NSInvocation *invocation = [method staticInvocation];
[invocation invoke]; [invocation invoke];
id result = nil; __unsafe_unretained id result = nil;
[invocation getReturnValue:&result]; [invocation getReturnValue:&result];
return yail_make_native_instance(pic, result); return yail_make_native_instance(pic, result);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment