Skip to content

Commit d0cd1a6

Browse files
committed
Fixed a array out of bounds access error (when current state is -1) setting the initial state.
1 parent acf1b0e commit d0cd1a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

FSM/FiniteStateMachine.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ namespace Core
686686
throw Exception("Out of bounds state id number.");
687687
}
688688

689-
if ( state_table[current_state]->IsStoringForwarding() )
689+
if ( current_state != SentinelStateID && state_table[current_state]->IsStoringForwarding() )
690690
{
691691
// Clear any stored events since this method essentially acts as
692692
// a state machine reset function.

0 commit comments

Comments
 (0)