|
|
|
@ -609,7 +609,8 @@ module_new_from_json(char *file_name)
|
|
|
|
|
{
|
|
|
|
|
module->is_parent = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module->left_module = NULL;
|
|
|
|
|
module->right_module = NULL;
|
|
|
|
|
nodes[i] = module;
|
|
|
|
|
// if (tail_module != NULL) { tail_module->next_module = module; }
|
|
|
|
|
// tail_module = module;
|
|
|
|
@ -630,11 +631,11 @@ module_new_from_json(char *file_name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (module_count == 0) panic("%s contained no active modules\n", file_name);
|
|
|
|
|
for (int i = 0; i <= module_count; i++) {
|
|
|
|
|
for (int i = 0; i < module_count; i++) {
|
|
|
|
|
int left_index = 2 * i + 1;
|
|
|
|
|
int right_index = 2 * i + 2;
|
|
|
|
|
if (left_index <= module_count) nodes[i]->left_module = nodes[left_index];
|
|
|
|
|
if (right_index <= module_count) nodes[i]->right_module = nodes[right_index];
|
|
|
|
|
if (left_index < module_count) nodes[i]->left_module = nodes[left_index];
|
|
|
|
|
if (right_index < module_count) nodes[i]->right_module = nodes[right_index];
|
|
|
|
|
}
|
|
|
|
|
free(nodes);
|
|
|
|
|
#ifdef LOG_MODULE_LOADING
|
|
|
|
|