]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: replace mentions of "raised" with "panicked"
authorMark Freeman <mark@golang.org>
Mon, 5 May 2025 16:33:46 +0000 (12:33 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 6 May 2025 19:12:10 +0000 (12:12 -0700)
Fixes #73526

Change-Id: I4b801cf3e54b99559e6d5ca8fdb2fd0692a0d3a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/669975
TryBot-Bypass: Mark Freeman <mark@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <mark@golang.org>
Reviewed-by: Mark Freeman <mark@golang.org>
doc/next/4-runtime.md
src/cmd/go/testdata/script/test_cleanup_failnow.txt
src/cmd/go/testdata/script/test_fuzz_return.txt
src/runtime/crash_test.go
src/runtime/panic.go
src/runtime/runtime2.go
src/runtime/testdata/testprog/crash.go

index b6b50f1c0a755f96669b439c1d56fd275764eec9..e19996863df4cd1d25f1586182e51c4ef7ab7a7a 100644 (file)
@@ -3,11 +3,11 @@
 <!-- go.dev/issue/71517 -->
 
 The message printed when a program exits due to an unhandled panic
-that was recovered and re-raised no longer repeats the text of
+that was recovered and repanicked no longer repeats the text of
 the panic value.
 
 Previously, a program which panicked with `panic("PANIC")`,
-recovered the panic, and then re-panicked with the original
+recovered the panic, and then repanicked with the original
 value would print:
 
     panic: PANIC [recovered]
@@ -15,7 +15,7 @@ value would print:
 
 This program will now print:
 
-    panic: PANIC [recovered, reraised]
+    panic: PANIC [recovered, repanicked]
 
 <!-- go.dev/issue/71546 -->
 
index 80182cd9e3fae98f5325e238d008e4ebd6a1da72..8f39d98852ec201b3d8bd61549667098f1f0c85a 100644 (file)
@@ -14,8 +14,8 @@ env GOGC=off
 
 ! go test -v cleanup_failnow/panic_nocleanup_test.go
 ! stdout 'no tests to run'
-stdout '(?s)panic: die \[recovered, reraised\]'
-! stdout '(?s)panic: die \[recovered, reraised\].*panic: die'
+stdout '(?s)panic: die \[recovered, repanicked\]'
+! stdout '(?s)panic: die \[recovered, repanicked\].*panic: die'
 
 ! go test -v cleanup_failnow/panic_withcleanup_test.go
 ! stdout 'no tests to run'
index d86783e9cb9bb177469bedf1d982fbf601f3295f..c0540efb23342d0594890b4863dbba2405f6321e 100644 (file)
@@ -3,7 +3,7 @@
 # Disable vet, as its "tests" analyzer would report the same problem statically.
 
 ! go test -vet=off .
-stdout '^panic: testing: fuzz target must not return a value \[recovered, reraised\]$'
+stdout '^panic: testing: fuzz target must not return a value \[recovered, repanicked\]$'
 
 -- go.mod --
 module test
index 8504455088589dee12f105cb251235cfd9fa6edd..74af1acd1fcefcbf7cd011aa56195ad011780719 100644 (file)
@@ -357,19 +357,19 @@ panic: third panic
 
 }
 
-func TestReraisedPanic(t *testing.T) {
-       output := runTestProg(t, "testprog", "ReraisedPanic")
-       want := `panic: message [recovered, reraised]
+func TestRepanickedPanic(t *testing.T) {
+       output := runTestProg(t, "testprog", "RepanickedPanic")
+       want := `panic: message [recovered, repanicked]
 `
        if !strings.HasPrefix(output, want) {
                t.Fatalf("output does not start with %q:\n%s", want, output)
        }
 }
 
-func TestReraisedMiddlePanic(t *testing.T) {
-       output := runTestProg(t, "testprog", "ReraisedMiddlePanic")
+func TestRepanickedMiddlePanic(t *testing.T) {
+       output := runTestProg(t, "testprog", "RepanickedMiddlePanic")
        want := `panic: inner [recovered]
-       panic: middle [recovered, reraised]
+       panic: middle [recovered, repanicked]
        panic: outer
 `
        if !strings.HasPrefix(output, want) {
@@ -377,8 +377,8 @@ func TestReraisedMiddlePanic(t *testing.T) {
        }
 }
 
-func TestReraisedPanicSandwich(t *testing.T) {
-       output := runTestProg(t, "testprog", "ReraisedPanicSandwich")
+func TestRepanickedPanicSandwich(t *testing.T) {
+       output := runTestProg(t, "testprog", "RepanickedPanicSandwich")
        want := `panic: outer [recovered]
        panic: inner [recovered]
        panic: outer
index 07a96a237b887684155852289b806ada6a6910c8..281fe04bcae6e9901e3d93a8b4ec628310d8950f 100644 (file)
@@ -635,8 +635,8 @@ func preprintpanics(p *_panic) {
        for p != nil {
                if p.link != nil && *efaceOf(&p.link.arg) == *efaceOf(&p.arg) {
                        // This panic contains the same value as the next one in the chain.
-                       // Mark it as reraised. We will skip printing it twice in a row.
-                       p.link.reraised = true
+                       // Mark it as repanicked. We will skip printing it twice in a row.
+                       p.link.repanicked = true
                        p = p.link
                        continue
                }
@@ -655,7 +655,7 @@ func preprintpanics(p *_panic) {
 func printpanics(p *_panic) {
        if p.link != nil {
                printpanics(p.link)
-               if p.link.reraised {
+               if p.link.repanicked {
                        return
                }
                if !p.link.goexit {
@@ -667,8 +667,8 @@ func printpanics(p *_panic) {
        }
        print("panic: ")
        printpanicval(p.arg)
-       if p.reraised {
-               print(" [recovered, reraised]")
+       if p.repanicked {
+               print(" [recovered, repanicked]")
        } else if p.recovered {
                print(" [recovered]")
        }
index 05cf345baf6431cf0b6ba8e13d1b0100875183ad..5f36015e99f40dd1613653fe6662ce0a922c4c92 100644 (file)
@@ -1013,7 +1013,7 @@ type _panic struct {
        slotsPtr     unsafe.Pointer
 
        recovered   bool // whether this panic has been recovered
-       reraised    bool // whether this panic was reraised
+       repanicked  bool // whether this panic repanicked
        goexit      bool
        deferreturn bool
 }
index 56dd701ffb373cab497d2e90e838dc6dcb9c8ad4..556215a71ea08fbe45fb2762a0c377a2cad55004 100644 (file)
@@ -19,9 +19,9 @@ func init() {
        register("StringPanic", StringPanic)
        register("NilPanic", NilPanic)
        register("CircularPanic", CircularPanic)
-       register("ReraisedPanic", ReraisedPanic)
-       register("ReraisedMiddlePanic", ReraisedMiddlePanic)
-       register("ReraisedPanicSandwich", ReraisedPanicSandwich)
+       register("RepanickedPanic", RepanickedPanic)
+       register("RepanickedMiddlePanic", RepanickedMiddlePanic)
+       register("RepanickedPanicSandwich", RepanickedPanicSandwich)
 }
 
 func test(name string) {
@@ -141,14 +141,14 @@ func CircularPanic() {
        panic(exampleCircleStartError{})
 }
 
-func ReraisedPanic() {
+func RepanickedPanic() {
        defer func() {
                panic(recover())
        }()
        panic("message")
 }
 
-func ReraisedMiddlePanic() {
+func RepanickedMiddlePanic() {
        defer func() {
                recover()
                panic("outer")
@@ -173,9 +173,9 @@ func ReraisedMiddlePanic() {
 //     recovered, panic("inner") =>
 //     panic(recovered outer panic value)
 //
-// Exercises the edge case where we reraise a panic value,
+// Exercises the edge case where we repanic a panic value,
 // but with another panic in the middle.
-func ReraisedPanicSandwich() {
+func RepanickedPanicSandwich() {
        var outer any
        defer func() {
                recover()