In an article about the _cdecl calling convention, the writer mentioned:
Release local storage When the function allocates local, temporary space, it does so by decrementing from the stack point the amount of space needed, and this process must be reversed to reclaim that space. It's usually done by adding to the stack pointer the same amount which was subtracted previously, though a series of POP instructions could achieve the same thing.
My question is: could I simply set ESP to the current EBP value instead of "adding to the stack pointer the same amount which was subtracted" or a "series of POP instructions"?
Like:
mov esp, ebp
Seems like a better way to me, because if I later change the number of local variables of this function, I won't have to bother about incrementing the value afterwards.