mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 10:47:27 +08:00 
			
		
		
		
	service/dap: do not attempt further loading on unreadable string vars (#4016)
Do not attempt further loading of unreadable string vars because their Value field will be nil, causing a panic, and also it can't possibly work. Fixes #4010
This commit is contained in:
		 Alessandro Arzilli
					Alessandro Arzilli
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							3a2409b13f
						
					
				
				
					commit
					7c9b7d8dca
				
			| @ -2899,7 +2899,7 @@ func (s *Session) onEvaluateRequest(request *dap.EvaluateRequest) { | |||||||
| 		ctxt := request.Arguments.Context | 		ctxt := request.Arguments.Context | ||||||
| 		switch ctxt { | 		switch ctxt { | ||||||
| 		case "repl", "variables", "hover", "clipboard": | 		case "repl", "variables", "hover", "clipboard": | ||||||
| 			if exprVar.Kind == reflect.String { | 			if exprVar.Kind == reflect.String && exprVar.Unreadable == nil { | ||||||
| 				if strVal := constant.StringVal(exprVar.Value); exprVar.Len > int64(len(strVal)) { | 				if strVal := constant.StringVal(exprVar.Value); exprVar.Len > int64(len(strVal)) { | ||||||
| 					// Reload the string value with a bigger limit. | 					// Reload the string value with a bigger limit. | ||||||
| 					loadCfg := DefaultLoadConfig | 					loadCfg := DefaultLoadConfig | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user