attempt to get the stack trace logic right; fix boundaries

This commit is contained in:
Araq
2017-12-13 13:48:48 +01:00
committed by Andreas Rumpf
parent b3055d8735
commit 1c2dee18d0

View File

@@ -237,10 +237,10 @@ proc mergeEntries(entries: seq[StackTraceEntry]): seq[StackTraceEntry] =
# either the nested block is new, then we insert it, or we discard it
# completely. 'diff' is the wrong idea here.
var last = result.len
var last = result.len-1
var e = reRaiseEnd-1
var newBlock = true
while last > 0 and e > i+1:
while last >= 0 and e >= i+1:
if result[last] != entries[e]:
newBlock = false
break