summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-03-27 08:22:19 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-03-27 08:22:19 +0100
commitcfde02f4d2a24ca55b40cc6a3ad05fc38a429a7a (patch)
tree10d19a0b3f22a86fa256b030df51d3848d70afaa
parent1fc3fd768ca2f66a8cd7cc396ad834b13b0f2715 (diff)
parent0e84e53f47e859ff8d4617747a9075947e79c017 (diff)
downloadluaotfload-cfde02f4d2a24ca55b40cc6a3ad05fc38a429a7a.tar.gz
Merge pull request #210 from phi-gamma/texlive2014
[tool] fix final stage of bisection
-rwxr-xr-xsrc/luaotfload-tool.lua7
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)