summaryrefslogtreecommitdiff
path: root/test/fixedbugs
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-06-01 13:57:46 -0400
committerRuss Cox <rsc@golang.org>2014-06-01 13:57:46 -0400
commit1f3eec3a14088d38815297feeea3b738a8b65a90 (patch)
tree218f27e731316d4b9656c7a8f71c57480040c15a /test/fixedbugs
parent80dcb8173b0abde86448fae343b67c3431903627 (diff)
downloadgo-1f3eec3a14088d38815297feeea3b738a8b65a90.tar.gz
runtime: fix correctness test at end of traceback
We were requiring that the defer stack and the panic stack be completely processed, thinking that if any were left over the stack scan and the defer stack/panic stack must be out of sync. It turns out that the panic stack may well have leftover entries in some situations, and that's okay. Fixes issue 8132. LGTM=minux, r R=golang-codereviews, minux, r CC=golang-codereviews, iant, khr https://codereview.appspot.com/100900044
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/issue8132.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/fixedbugs/issue8132.go b/test/fixedbugs/issue8132.go
new file mode 100644
index 000000000..52f5d39c2
--- /dev/null
+++ b/test/fixedbugs/issue8132.go
@@ -0,0 +1,32 @@
+// run
+
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// issue 8132. stack walk handling of panic stack was confused
+// about what was legal.
+
+package main
+
+import "runtime"
+
+var p *int
+
+func main() {
+ func() {
+ defer func() {
+ runtime.GC()
+ recover()
+ }()
+ var x [8192]byte
+ func(x [8192]byte) {
+ defer func() {
+ if err := recover(); err != nil {
+ println(*p)
+ }
+ }()
+ println(*p)
+ }(x)
+ }()
+}