mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
compiler: mark stringFromBytes as nocapture/readonly to help escape analysis
Fixes #4525
This commit is contained in:
Vendored
+5
@@ -49,6 +49,11 @@ func main() {
|
||||
n4 = n5
|
||||
}()
|
||||
println(n4, n5)
|
||||
|
||||
// This shouldn't escape.
|
||||
var buf [32]byte
|
||||
s := string(buf[:])
|
||||
println(len(s))
|
||||
}
|
||||
|
||||
func derefInt(x *int) int {
|
||||
|
||||
Reference in New Issue
Block a user