aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-03-16 10:31:57 -0700
committerIan Lance Taylor <iant@golang.org>2022-03-16 13:52:32 -0700
commit69921f4a7ec081c5b37dae13e3372003e4efd49f (patch)
tree3c485503e44039e60d49bc2450e9a28153496706 /libgo/go/runtime
parent7fd6e36ea9aa8575841ff1da08b4aebc0298abe2 (diff)
downloadgcc-69921f4a7ec081c5b37dae13e3372003e4efd49f.zip
gcc-69921f4a7ec081c5b37dae13e3372003e4efd49f.tar.gz
gcc-69921f4a7ec081c5b37dae13e3372003e4efd49f.tar.bz2
libgo: update to final Go 1.18 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/393377
Diffstat (limited to 'libgo/go/runtime')
-rw-r--r--libgo/go/runtime/mfinal_test.go9
-rw-r--r--libgo/go/runtime/testdata/testprogcgo/aprof.go2
2 files changed, 10 insertions, 1 deletions
diff --git a/libgo/go/runtime/mfinal_test.go b/libgo/go/runtime/mfinal_test.go
index 81c924f..2eb60b9 100644
--- a/libgo/go/runtime/mfinal_test.go
+++ b/libgo/go/runtime/mfinal_test.go
@@ -45,6 +45,15 @@ func TestFinalizerType(t *testing.T) {
{func(x *int) any { return Tintptr(x) }, func(v *int) { finalize(v) }},
{func(x *int) any { return (*Tint)(x) }, func(v *Tint) { finalize((*int)(v)) }},
{func(x *int) any { return (*Tint)(x) }, func(v Tinter) { finalize((*int)(v.(*Tint))) }},
+ // Test case for argument spill slot.
+ // If the spill slot was not counted for the frame size, it will (incorrectly) choose
+ // call32 as the result has (exactly) 32 bytes. When the argument actually spills,
+ // it clobbers the caller's frame (likely the return PC).
+ {func(x *int) any { return x }, func(v any) [4]int64 {
+ print() // force spill
+ finalize(v.(*int))
+ return [4]int64{}
+ }},
}
for i, tt := range finalizerTests {
diff --git a/libgo/go/runtime/testdata/testprogcgo/aprof.go b/libgo/go/runtime/testdata/testprogcgo/aprof.go
index c70d633..1687014 100644
--- a/libgo/go/runtime/testdata/testprogcgo/aprof.go
+++ b/libgo/go/runtime/testdata/testprogcgo/aprof.go
@@ -10,7 +10,7 @@ package main
// This is a regression test for issue 14599, where profiling fails when the
// function is the first C function. Exported functions are the first C
// functions, so we use an exported function. Exported functions are created in
-// lexigraphical order of source files, so this file is named aprof.go to
+// lexicographical order of source files, so this file is named aprof.go to
// ensure its function is first.
// extern void CallGoNop();