fix crash output

This commit is contained in:
Dmitry Vyukov 2015-11-05 19:41:57 +01:00
parent b95ad23cfe
commit bb15aa8bfd
2 changed files with 10 additions and 4 deletions

View File

@ -254,8 +254,11 @@ func (inst *Instance) Run() {
outputMu.Unlock()
time.Sleep(5 * time.Second)
outputMu.Lock()
output = output[matchPos:]
loc = crashRe.FindAllIndex(output, -1)
loc = crashRe.FindAllIndex(output[matchPos:], -1)
for i := range loc {
loc[i][0] += matchPos
loc[i][1] += matchPos
}
start := loc[0][0] - contextSize
if start < 0 {
start = 0

View File

@ -291,8 +291,11 @@ func (inst *Instance) Run() {
outputMu.Unlock()
time.Sleep(5 * time.Second)
outputMu.Lock()
output = output[matchPos:]
loc = crashRe.FindAllIndex(output, -1)
loc = crashRe.FindAllIndex(output[matchPos:], -1)
for i := range loc {
loc[i][0] += matchPos
loc[i][1] += matchPos
}
start := loc[0][0] - contextSize
if start < 0 {
start = 0