Stick a printf/file write/breakpoint at the root of the code path if you want continuous verification that the code path never executes except by clicking the button. This isn't hard.
Static analysis is a thing, and it doesn't solve the halting problem.