diff options
| author | Russ Cox <rsc@golang.org> | 2010-04-01 22:31:27 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-04-01 22:31:27 -0700 |
| commit | fb96dda6e66ab75e6cbcdfad2575fddd49eb5857 (patch) | |
| tree | 285fdef711a90a79f5cabf60b35dfe3b877702a0 /src/pkg/runtime/slice.c | |
| parent | c536850d434ae3dd242417175287cd74c47d9063 (diff) | |
| download | golang-fb96dda6e66ab75e6cbcdfad2575fddd49eb5857.tar.gz | |
runtime: turn run time errors checks into panics
R=ken2, r
CC=golang-dev
http://codereview.appspot.com/871042
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/runtime/slice.c')
| -rw-r--r-- | src/pkg/runtime/slice.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/pkg/runtime/slice.c b/src/pkg/runtime/slice.c index 03572e822..ca2585c79 100644 --- a/src/pkg/runtime/slice.c +++ b/src/pkg/runtime/slice.c @@ -36,19 +36,6 @@ void } } -static void -throwslice(uint32 lb, uint32 hb, uint32 n) -{ - prints("slice["); - ·printint(lb); - prints(":"); - ·printint(hb); - prints("] of ["); - ·printint(n); - prints("] array\n"); - throw("array slice"); -} - // sliceslice(old []any, lb int, hb int, width int) (ary []any); void ·sliceslice(Slice old, uint32 lb, uint32 hb, uint32 width, Slice ret) @@ -71,7 +58,7 @@ void ·printint(old.cap); prints("\n"); } - throwslice(lb, hb, old.cap); + ·panicslice(); } // new array is inside old array @@ -116,7 +103,7 @@ void ·printint(old.cap); prints("\n"); } - throwslice(lb, old.len, old.cap); + ·panicslice(); } // new array is inside old array @@ -165,7 +152,7 @@ void ·printint(width); prints("\n"); } - throwslice(lb, hb, nel); + ·panicslice(); } // new array is inside old array |
