aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorEmmanuel Odeke <emm.odeke@gmail.com>2016-03-27 17:29:53 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2016-04-10 01:16:30 +0000
commite4f1d9cf2e948eb0f0bb91d7c253ab61dfff3a59 (patch)
tree3d4cf398d6235b777cb0de186d03369d8d598f2a /src/runtime/malloc.go
parent824d8c10fe5e1026c15cbece41ee372b1fd333f3 (diff)
downloadgo-e4f1d9cf2e948eb0f0bb91d7c253ab61dfff3a59.tar.xz
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>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index 5f1e2f64c0..ee4728c9a5 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -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)
}