proc: do not panic if we can't satisfy a composite location

When a location expression requests a register check that we have as
many bytes in the register as requested and if we don't report the
error.

Updates #1416
This commit is contained in:
aarzilli
2018-11-19 14:22:43 +01:00
committed by Derek Parker
parent 11accd4d71
commit 7f53117ea9
2 changed files with 10 additions and 3 deletions

View File

@ -908,7 +908,10 @@ func (scope *EvalScope) extractVarInfoFromEntry(varEntry *dwarf.Entry) (*Variabl
mem := scope.Mem
if pieces != nil {
addr = fakeAddress
mem = newCompositeMemory(scope.Mem, scope.Regs, pieces)
mem, err = newCompositeMemory(scope.Mem, scope.Regs, pieces)
if mem == nil {
mem = scope.Mem
}
}
v := scope.newVariable(n, uintptr(addr), t, mem)