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
Was writing some benchmarks the other day and made the mistake of returning a pointer to the stack, what I did specifically was create an array or random u8's and attempted to return str[0..];, I can see now that this is incorrect but seems like something that the compiler/debug mode should warn or error.
Currently it returns the value but if you attempt to access it will just be random data. I don't know how possible this is and am fairly new to low level programming so it may just be something that is not worth having, but thought it was worth mentioning.
The text was updated successfully, but these errors were encountered:
Was writing some benchmarks the other day and made the mistake of returning a pointer to the stack, what I did specifically was create an array or random
u8
's and attempted toreturn str[0..];
, I can see now that this is incorrect but seems like something that the compiler/debug mode should warn or error.Currently it returns the value but if you attempt to access it will just be random data. I don't know how possible this is and am fairly new to low level programming so it may just be something that is not worth having, but thought it was worth mentioning.
The text was updated successfully, but these errors were encountered: