I'm wondering if it makes sense to push the return value of a function in its the stack-frame.
I know return values are mostly stored in registers (eax for gcc), but is it for performance only?
Thanks!
it makes sense, but it must be manually inserted (and not a simple push). the 'space' for it should be 'allocated' by the caller (it must decrease sp before calling the function) because when you return from the function - the return address must be at the top of the stack, so the return value should be below the return address. [same principle as passing arguments on stack]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With