mirror of
https://github.com/go-delve/delve.git
synced 2025-11-03 22:08:33 +08:00
service/dap: fix nil ptr deref when current addr is not in a func (#3157)
Fixes nil pointer dereference when current PC address does not belong to any known func. Fixes #3156
This commit is contained in:
committed by
GitHub
parent
cd8cf3b1b7
commit
6440b3ba92
@ -2014,7 +2014,11 @@ func (s *Session) onScopesRequest(request *dap.ScopesRequest) {
|
||||
// Check if the function is optimized.
|
||||
fn, err := s.debugger.Function(int64(goid), frame, 0, DefaultLoadConfig)
|
||||
if fn == nil || err != nil {
|
||||
s.sendErrorResponse(request.Request, UnableToListArgs, "Unable to find enclosing function", err.Error())
|
||||
var details string
|
||||
if err != nil {
|
||||
details = err.Error()
|
||||
}
|
||||
s.sendErrorResponse(request.Request, UnableToListArgs, "Unable to find enclosing function", details)
|
||||
return
|
||||
}
|
||||
suffix := ""
|
||||
|
||||
Reference in New Issue
Block a user