From 7e0b49edd14b4822a26af7a66d041aa1ffa43b13 Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Sun, 16 Nov 2014 17:27:37 +0100 Subject: [PATCH] fix dump() recursion detection only detect recursions for table values. --- frontend/dump.lua | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/dump.lua b/frontend/dump.lua index 2f152ee9a..cd1ba9dff 100644 --- a/frontend/dump.lua +++ b/frontend/dump.lua @@ -13,17 +13,16 @@ local function _serialize(what, outt, indent, max_lv, history) return end - history = history or {} - for up, item in ipairs(history) do - if item == what then - insert(outt, "nil --[[ LOOP:\n") - insert(outt, string.rep("\t", indent - up)) - insert(outt, "^------- ]]") - return - end - end - if type(what) == "table" then + history = history or {} + for up, item in ipairs(history) do + if item == what then + insert(outt, "nil --[[ LOOP:\n") + insert(outt, string.rep("\t", indent - up)) + insert(outt, "^------- ]]") + return + end + end local new_history = { what, unpack(history) } local didrun = false insert(outt, "{")