aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/panic.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/panic.go')
-rw-r--r--src/runtime/panic.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/panic.go b/src/runtime/panic.go
index f78e67f9bb..73924365c3 100644
--- a/src/runtime/panic.go
+++ b/src/runtime/panic.go
@@ -168,6 +168,10 @@ func testdefersizes() {
// immediately after the _defer header in memory.
//go:nosplit
func deferArgs(d *_defer) unsafe.Pointer {
+ if d.siz == 0 {
+ // Avoid pointer past the defer allocation.
+ return nil
+ }
return add(unsafe.Pointer(d), unsafe.Sizeof(*d))
}