diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-03-27 08:21:10 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-03-27 08:21:10 +0100 |
commit | 0e84e53f47e859ff8d4617747a9075947e79c017 (patch) | |
tree | 10d19a0b3f22a86fa256b030df51d3848d70afaa | |
parent | e2966b1932f0cb00da4acf6dc8678366dd180e62 (diff) | |
download | luaotfload-0e84e53f47e859ff8d4617747a9075947e79c017.tar.gz |
[tool] fix final stage of bisection
-rwxr-xr-x | src/luaotfload-tool.lua | 7 |
1 files changed, 5 insertions, 2 deletions
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) |