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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -473,7 +473,7 @@ func (scope *EvalScope) PackageVariables(cfg LoadConfig) ([]*Variable, error) {
// 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))
if val.Kind == reflect.Invalid {
if val != nil && val.Kind == reflect.Invalid {
continue
}
if err != nil {