Skip to content

Commit 8adc9c1

Browse files
committed
transform: add test for stringFromBytes() escape aalysis
1 parent 3d44e39 commit 8adc9c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

transform/testdata/allocs2.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ func main() {
4949
n4 = n5
5050
}()
5151
println(n4, n5)
52+
53+
// This shouldn't escape.
54+
var buf [32]byte
55+
s := string(buf[:])
56+
println(len(s))
5257
}
5358

5459
func derefInt(x *int) int {

0 commit comments

Comments
 (0)