I think it would be safer to keep the `state.forinifcheckneeded` flag. The idea is to only perform the check for the first `if` statement inside the loop body. The `forinifchecks` stack will be non-empty for every `if` statement inside the body but the flag will only be `true` for the very first one.