A failure diagnosis for a slide sensor of a variable valve mechanism is
performed when a valve working angle is at a value in the initial state.
The initial state is set to a valve characteristic state where the valve
working angle is at the maximum value. The maximum valve working angle
corresponds to the refuge running performable region in which an engine
can be started and refuge running can be performed. Therefore, even when
it is difficult to adjust the valve working angle using rotation of a
spiral cam due to a failure in the slide sensor, the refuge running can
be performed only by maintaining the initial state by maintaining
control. It is thus possible to increase reliability of the refuge
running in the case where a failure has occurred in the variable valve
mechanism.