StudlyCaps wrote:
goku420: I was more thinking of a static analysis situation where you're trying to find out before starting a program if it will fault or not. In that case you'd have to have to do some type of state machine analysis to determine if the variable will be valid in all cases when the code actually runs.
This would only work for degenerate cases like null pointer dereferences, otherwise like you said it is essentially the halting problem. However, the behavior of your page fault handler ultimately doesn't matter since the danger in invalid pointers comes from type punning, violating strict aliasing, out of bounds, etc. The latter three cases are easily caught by static analyzers.