diff --git a/src/runtime/panic.go b/src/runtime/panic.go index f78e67f9bb208..73924365c34da 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)) } diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index 88f4139ba3365..b73a97f73567f 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -233,32 +233,32 @@ func time_now() (sec int64, nsec int32) // in asm_*.s // not called directly; definitions here supply type information for traceback. -func call32(fn, arg unsafe.Pointer, n, retoffset uint32) -func call64(fn, arg unsafe.Pointer, n, retoffset uint32) -func call128(fn, arg unsafe.Pointer, n, retoffset uint32) -func call256(fn, arg unsafe.Pointer, n, retoffset uint32) -func call512(fn, arg unsafe.Pointer, n, retoffset uint32) -func call1024(fn, arg unsafe.Pointer, n, retoffset uint32) -func call2048(fn, arg unsafe.Pointer, n, retoffset uint32) -func call4096(fn, arg unsafe.Pointer, n, retoffset uint32) -func call8192(fn, arg unsafe.Pointer, n, retoffset uint32) -func call16384(fn, arg unsafe.Pointer, n, retoffset uint32) -func call32768(fn, arg unsafe.Pointer, n, retoffset uint32) -func call65536(fn, arg unsafe.Pointer, n, retoffset uint32) -func call131072(fn, arg unsafe.Pointer, n, retoffset uint32) -func call262144(fn, arg unsafe.Pointer, n, retoffset uint32) -func call524288(fn, arg unsafe.Pointer, n, retoffset uint32) -func call1048576(fn, arg unsafe.Pointer, n, retoffset uint32) -func call2097152(fn, arg unsafe.Pointer, n, retoffset uint32) -func call4194304(fn, arg unsafe.Pointer, n, retoffset uint32) -func call8388608(fn, arg unsafe.Pointer, n, retoffset uint32) -func call16777216(fn, arg unsafe.Pointer, n, retoffset uint32) -func call33554432(fn, arg unsafe.Pointer, n, retoffset uint32) -func call67108864(fn, arg unsafe.Pointer, n, retoffset uint32) -func call134217728(fn, arg unsafe.Pointer, n, retoffset uint32) -func call268435456(fn, arg unsafe.Pointer, n, retoffset uint32) -func call536870912(fn, arg unsafe.Pointer, n, retoffset uint32) -func call1073741824(fn, arg unsafe.Pointer, n, retoffset uint32) +func call32(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call64(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call128(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call256(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call512(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call1024(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call2048(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call4096(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call8192(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call16384(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call32768(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call65536(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call131072(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call262144(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call524288(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call1048576(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call2097152(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call4194304(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call8388608(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call16777216(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call33554432(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call67108864(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call134217728(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call268435456(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call536870912(typ, fn, arg unsafe.Pointer, n, retoffset uint32) +func call1073741824(typ, fn, arg unsafe.Pointer, n, retoffset uint32) func systemstack_switch()