Update eval.go (#2110)

Check val != nil to ignore possible crash.
Related to #2101
This commit is contained in:
Mostafa Sedaghat Joo
2020-07-27 10:24:29 +08:00
committed by GitHub
parent 54664c54db
commit 3d896ece07

View File

@ -473,7 +473,7 @@ func (scope *EvalScope) PackageVariables(cfg LoadConfig) ([]*Variable, error) {
// Ignore errors trying to extract values // Ignore errors trying to extract values
val, err := extractVarInfoFromEntry(scope.BinInfo, pkgvar.cu.image, regsReplaceStaticBase(scope.Regs, pkgvar.cu.image), scope.Mem, godwarf.EntryToTree(entry)) val, err := extractVarInfoFromEntry(scope.BinInfo, pkgvar.cu.image, regsReplaceStaticBase(scope.Regs, pkgvar.cu.image), scope.Mem, godwarf.EntryToTree(entry))
if val.Kind == reflect.Invalid { if val != nil && val.Kind == reflect.Invalid {
continue continue
} }
if err != nil { if err != nil {