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
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 # either the nested block is new, then we insert it, or we discard it
# completely. 'diff' is the wrong idea here. # completely. 'diff' is the wrong idea here.
var last = result.len var last = result.len-1
var e = reRaiseEnd-1 var e = reRaiseEnd-1
var newBlock = true var newBlock = true
while last > 0 and e > i+1: while last >= 0 and e >= i+1:
if result[last] != entries[e]: if result[last] != entries[e]:
newBlock = false newBlock = false
break break