You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Named return value sidesteps "unsafe stack variable returned"
code
foo :: proc () -> ^int {
v: intreturn &v // It is unsafe to return the address of a local variable ('&v') from a procedure, as it uses the current stack frame's memory
}
bar :: proc () -> (p: ^int) {
v: int
p = &v
return// no error
}
Named return value sidesteps "unsafe stack variable returned"
code
report
The text was updated successfully, but these errors were encountered: