From 0e84e53f47e859ff8d4617747a9075947e79c017 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 27 Mar 2014 08:21:10 +0100 Subject: [tool] fix final stage of bisection --- src/luaotfload-tool.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/luaotfload-tool.lua') diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua index 47e7ccc..41e61f2 100755 --- a/src/luaotfload-tool.lua +++ b/src/luaotfload-tool.lua @@ -964,7 +964,7 @@ local bisect_set = function (outcome) hi = pivot if lo >= hi then --- complete status[nsteps + 1] = { lo, lo, lo } - status[nsteps + 1] = true + status[nsteps + 2] = true write_bisect_status (status) return bisect_terminate (nsteps, lo) end @@ -977,7 +977,7 @@ local bisect_set = function (outcome) if lo >= hi then --- complete status[nsteps + 1] = { lo, lo, lo } write_bisect_status (status) - status[nsteps + 1] = true + status[nsteps + 2] = true return bisect_terminate (nsteps, lo) end pivot = mathfloor ((lo + hi) / 2) @@ -1040,6 +1040,9 @@ local bisect_run = function () local nsteps = #status local currentstep = nsteps + 1 local current = status[nsteps] + if current == true then -- final step + current = status[nsteps - 1] + end local lo, hi, pivot = unpack (current) report ("info", 3, "bisect", "Previous step %d: lo=%d, hi=%d, pivot=%d.", nsteps, lo, hi, pivot) -- cgit v1.2.3