Each invocation of fun
needs its own place to store the variable. But as soon as the function returns, the variable no longer exists. There's no reason the address can't be re-used. It doesn't have to be, but there's no reason it can't be.
In a typical implementation, stack space is used to hold the information needed to return from a function and their local variables when a function is invoked. When the function returns, the local variables are removed from the stack and the return information popped off it, leaving the stack back where it was when the function was called. Since the two function invocations are the same, they wind up with the stack the same in both cases, making the local variable have the same address. This is what an experienced programmer would would expect, but not rely on.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…