mirror of
				https://github.com/golang/go.git
				synced 2025-10-31 08:40:55 +00:00 
			
		
		
		
	runtime: make execution error panic values implement the Error interface
Make execution panics implement Error as mandated by https://golang.org/ref/spec#Run_time_panics, instead of panics with strings. Fixes #14965 Change-Id: I7827f898b9b9c08af541db922cc24fa0800ff18a Reviewed-on: https://go-review.googlesource.com/21214 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
		
							parent
							
								
									824d8c10fe
								
							
						
					
					
						commit
						e4f1d9cf2e
					
				
					 7 changed files with 68 additions and 11 deletions
				
			
		|  | @ -793,7 +793,7 @@ func newarray(typ *_type, n uintptr) unsafe.Pointer { | |||
| 		flags |= flagNoScan | ||||
| 	} | ||||
| 	if int(n) < 0 || (typ.size > 0 && n > _MaxMem/typ.size) { | ||||
| 		panic("runtime: allocation size out of range") | ||||
| 		panic(plainError("runtime: allocation size out of range")) | ||||
| 	} | ||||
| 	return mallocgc(typ.size*n, typ, flags) | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Emmanuel Odeke
						Emmanuel Odeke