Diff

util/debug.lua @ 11177:37dc2a6144d1 0.11

util.debug: Fix locals being reported under wrong stack frame in some cases (+tests!!)
author Matthew Wild <mwild1@gmail.com>
date Fri, 16 Oct 2020 13:38:04 +0100
parent 8382:e5d00bf4a4d5
child 12250:e157e5c79daa
line wrap: on
line diff
--- a/util/debug.lua	Thu Oct 15 17:21:58 2020 +0200
+++ b/util/debug.lua	Fri Oct 16 13:38:04 2020 +0100
@@ -104,7 +104,7 @@
 		levels[(level-start_level)+1] = {
 			level = level;
 			info = info;
-			locals = get_locals_table(thread, level+(thread and 0 or 1));
+			locals = get_locals_table(thread, level+1);
 			upvalues = get_upvalues_table(info.func);
 		};
 	end