Commit 65ba5eb3 authored by Lars Buitinck's avatar Lars Buitinck

fix binary search in code object cache

(start + end) can overflow.
parent 392e1311
...@@ -348,7 +348,7 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co ...@@ -348,7 +348,7 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
return count; return count;
} }
while (start < end) { while (start < end) {
mid = (start + end) / 2; mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) { if (code_line < entries[mid].code_line) {
end = mid; end = mid;
} else if (code_line > entries[mid].code_line) { } else if (code_line > entries[mid].code_line) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment