aboutsummaryrefslogtreecommitdiffstats
path: root/util/async.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/async.lua')
-rw-r--r--util/async.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/async.lua b/util/async.lua
index 3a75e1c1..e16d5b24 100644
--- a/util/async.lua
+++ b/util/async.lua
@@ -23,6 +23,8 @@ local function runner_continue(thread)
local level = 0;
while debug.getinfo(thread, level, "") do level = level + 1; end
ok, runner = debug.getlocal(thread, level-1, 1);
+ assert(ok == "self", "unexpected async state: variable mismatch");
+ assert(runner.thread == thread, "unexpected async state: thread mismatch");
local error_handler = runner.watchers.error;
if error_handler then error_handler(runner, debug.traceback(thread, err)); end
local ready_handler = runner.watchers.ready;