From 6306b46ea13f165abfe4dddea74ced86dc3ee412 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 13 Nov 2020 16:51:53 -0500 Subject: [PATCH] chore: debug current_sandbox_get --- runtime/src/worker_thread.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/src/worker_thread.c b/runtime/src/worker_thread.c index 2887b5f..24d22a7 100644 --- a/runtime/src/worker_thread.c +++ b/runtime/src/worker_thread.c @@ -139,6 +139,13 @@ worker_thread_switch_to_base_context() assert(!software_interrupt_is_enabled()); struct sandbox *current_sandbox = current_sandbox_get(); +#ifndef NDEBUG + if (current_sandbox != NULL) { + assert(current_sandbox->state < SANDBOX_STATE_COUNT); + assert(current_sandbox->stack_size == current_sandbox->module->stack_size); + } +#endif + worker_thread_transition_exiting_sandbox(current_sandbox); /* Assumption: Base Context should never switch to Base Context */