Prevent multiple semantic running for statements

From #3206, I think it's more better way to fix [issue 11939](https://d.puremagic.com/issues/show_bug.cgi?id=11939).