aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata
diff options
context:
space:
mode:
authorYoulin Feng <fengyoulin@live.com>2025-10-29 13:11:48 +0800
committerGopher Robot <gobot@golang.org>2025-11-18 07:22:50 -0800
commitc93766007dbb9c975d2f18b7c741f4804ce911c0 (patch)
tree45c8edbd68ae43d5a55cb3662100fb4d3c104a2a /src/runtime/testdata
parent9859b436430aac382b337964a1b380bc4bfcda70 (diff)
downloadgo-c93766007dbb9c975d2f18b7c741f4804ce911c0.tar.xz
runtime: do not print recovered when double panic with the same value
Show the "[recovered, repanicked]" message only when it is repanicked after recovered. For the duplicated panics that not recovered, do not show this message. Fixes #76099 Change-Id: I87282022ebe44c6f6efbe3239218be4a2a7b1104 Reviewed-on: https://go-review.googlesource.com/c/go/+/716020 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/testdata')
-rw-r--r--src/runtime/testdata/testprog/crash.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprog/crash.go b/src/runtime/testdata/testprog/crash.go
index 556215a71e..fcce388871 100644
--- a/src/runtime/testdata/testprog/crash.go
+++ b/src/runtime/testdata/testprog/crash.go
@@ -22,6 +22,7 @@ func init() {
register("RepanickedPanic", RepanickedPanic)
register("RepanickedMiddlePanic", RepanickedMiddlePanic)
register("RepanickedPanicSandwich", RepanickedPanicSandwich)
+ register("DoublePanicWithSameValue", DoublePanicWithSameValue)
}
func test(name string) {
@@ -189,3 +190,13 @@ func RepanickedPanicSandwich() {
panic("outer")
}()
}
+
+// Double panic with same value and not recovered.
+// See issue 76099.
+func DoublePanicWithSameValue() {
+ var e any = "message"
+ defer func() {
+ panic(e)
+ }()
+ panic(e)
+}