|
@@ -789,8 +789,7 @@ void process_advance (struct process *p)
|
|
|
|
|
|
|
|
// need to determine the module and object to use it on (if it's a method)
|
|
// need to determine the module and object to use it on (if it's a method)
|
|
|
const struct NCDModule *module;
|
|
const struct NCDModule *module;
|
|
|
- NCDObject object;
|
|
|
|
|
- NCDObject *object_ptr = NULL;
|
|
|
|
|
|
|
+ void *method_context = NULL;
|
|
|
|
|
|
|
|
// get object names, e.g. "my.cat" in "my.cat->meow();"
|
|
// get object names, e.g. "my.cat" in "my.cat->meow();"
|
|
|
// (or NULL if this is not a method statement)
|
|
// (or NULL if this is not a method statement)
|
|
@@ -808,10 +807,11 @@ void process_advance (struct process *p)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// get object
|
|
// get object
|
|
|
|
|
+ NCDObject object;
|
|
|
if (!process_resolve_object_expr(p, p->ap, objnames, num_objnames, &object)) {
|
|
if (!process_resolve_object_expr(p, p->ap, objnames, num_objnames, &object)) {
|
|
|
goto fail0;
|
|
goto fail0;
|
|
|
}
|
|
}
|
|
|
- object_ptr = &object;
|
|
|
|
|
|
|
+ method_context = object.user;
|
|
|
|
|
|
|
|
// get object type
|
|
// get object type
|
|
|
NCD_string_id_t object_type = NCDObject_Type(&object);
|
|
NCD_string_id_t object_type = NCDObject_Type(&object);
|
|
@@ -862,7 +862,7 @@ void process_advance (struct process *p)
|
|
|
process_assert_pointers(p);
|
|
process_assert_pointers(p);
|
|
|
|
|
|
|
|
// initialize module instance
|
|
// initialize module instance
|
|
|
- NCDModuleInst_Init(&ps->inst, module, object_ptr, args, &p->interp->module_params);
|
|
|
|
|
|
|
+ NCDModuleInst_Init(&ps->inst, module, method_context, args, &p->interp->module_params);
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
fail1:
|
|
fail1:
|