EXIT_WITH_FAILURE;
}
- unlang_thread_instantiate(autofree);
-
/*
* Ensure that we load the correct virtual server for the
* protocol, if necessary.
*/
if (modules_thread_instantiate(thread_ctx, el) < 0) EXIT_WITH_FAILURE;
if (xlat_thread_instantiate(thread_ctx) < 0) EXIT_WITH_FAILURE;
+ unlang_thread_instantiate(thread_ctx);
/*
* Set the panic action (if required)
{
unlang_thread_t *t;
- if (!instruction->number) return;
+ if (!instruction->number || !unlang_thread_array) return;
+
+ fr_assert(instruction->number <= unlang_number);
t = &unlang_thread_array[instruction->number];
t->use_count++;
t->enter = fr_time();
-
}
void unlang_frame_perf_cleanup(unlang_t const *instruction)
{
unlang_thread_t *t;
- if (!instruction->number) return;
+ if (!instruction || !instruction->number || !unlang_thread_array) return;
+
+ fr_assert(instruction->number <= unlang_number);
t = &unlang_thread_array[instruction->number];
unlang_op_t *op;
char const *name;
-// unlang_frame_perf_init(frame->instruction);
+ unlang_frame_perf_init(instruction);
op = &unlang_ops[instruction->type];
name = op->frame_state_name ? op->frame_state_name : __location__;
TALLOC_FREE(frame->state);
}
-// unlang_frame_perf_cleanup(frame->instruction);
+ unlang_frame_perf_cleanup(frame->instruction);
}
/** Advance to the next sibling instruction