better state validation

This commit is contained in:
rusefi 2018-02-28 07:26:42 -05:00
parent 1361217845
commit a489d30fe2
1 changed files with 1 additions and 0 deletions

View File

@ -31,6 +31,7 @@ extern bool printTriggerDebug;
void TriggerStimulatorHelper::feedSimulatedEvent(TriggerState *state, TriggerShape * shape, int i
DECLARE_ENGINE_PARAMETER_SUFFIX) {
efiAssertVoid(shape->getSize() > 0, "size not zero");
int stateIndex = i % shape->getSize();
int prevIndex = (stateIndex + shape->getSize() - 1 ) % shape->getSize();