I apologize if this is not the right site to ask this, as the question is not about a proof assistant per se, but about a particular formalization.
In the semantics of the RTL intermediate language in CompCert, memory blocks are allocated and freed. At function start, the stack frame is allocated in memory, and it is freed at the end.
Assuming no external calls, it seems feasible to me (though I've not done it) to show that the stack frames that are on the current stack are still currently allocated in memory (until the stack is popped and the block freed as expected).
I however do not see how to prove that if a stack frame is allocated prior to an external call, it stays allocated. (In real life, of course, it is impossible to deallocate a caller's stackframe unless one does something like longjmp()
or other dark magic, but I'm discussing this particular formalization here.)
There are a number of semantic definitions in Events.v
that say what an external call is allowed to do, but I don't see anything preventing it from freeing a stack block.
Am I missing something?