diff options
| author | Ian Lance Taylor <iant@golang.org> | 2016-10-04 21:15:42 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2016-10-05 13:13:27 +0000 |
| commit | 7faf70239670c3c1f8b4b530aba8847a03860f2a (patch) | |
| tree | 2c7ca7c2412bc34f0ef77a317d2a7cc391707b99 /src/runtime/testdata | |
| parent | efaa36017e34b87a5731793594b42d483209d808 (diff) | |
| download | go-7faf70239670c3c1f8b4b530aba8847a03860f2a.tar.xz | |
runtime: avoid endless loop if printing the panic value panics
Change-Id: I56de359a5ccdc0a10925cd372fa86534353c6ca0
Reviewed-on: https://go-review.googlesource.com/30358
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/testdata')
| -rw-r--r-- | src/runtime/testdata/testprog/deadlock.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprog/deadlock.go b/src/runtime/testdata/testprog/deadlock.go index c938fcfb56..ca2be57911 100644 --- a/src/runtime/testdata/testprog/deadlock.go +++ b/src/runtime/testdata/testprog/deadlock.go @@ -32,6 +32,7 @@ func init() { register("PanicTraceback", PanicTraceback) register("GoschedInPanic", GoschedInPanic) register("SyscallInPanic", SyscallInPanic) + register("PanicLoop", PanicLoop) } func SimpleDeadlock() { @@ -214,3 +215,13 @@ func pt2() { }() panic("hello") } + +type panicError struct{} + +func (*panicError) Error() string { + panic("double error") +} + +func PanicLoop() { + panic(&panicError{}) +} |
