mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 11:37:46 +00:00
a683881eb7
Follow returned pointer aliases when deciding whether runtime.alloc calls can be lowered to stack allocations. A returned parameter is not the same as nocapture: it still flows back to the caller and must be checked as an alias of the original allocation. Keep the analysis conservative for recursive returned-parameter chains and unknown operands. The existing golden test now shows that the non-escaping returned pointer cases no longer require heap allocation.
13 lines
424 B
Plaintext
13 lines
424 B
Plaintext
testdata/allocs2.go:21.1,21.22 1 0
|
|
testdata/allocs2.go:24.1,24.43 1 0
|
|
testdata/allocs2.go:26.1,26.25 1 0
|
|
testdata/allocs2.go:29.1,29.22 1 0
|
|
testdata/allocs2.go:36.1,36.23 1 0
|
|
testdata/allocs2.go:44.1,44.23 1 0
|
|
testdata/allocs2.go:46.1,46.22 1 0
|
|
testdata/allocs2.go:49.1,49.9 1 0
|
|
testdata/allocs2.go:50.1,50.9 1 0
|
|
testdata/allocs2.go:107.1,107.21 1 0
|
|
testdata/allocs2.go:114.1,114.23 1 0
|
|
testdata/allocs2.go:128.1,128.23 1 0
|