From a4515712cb4ebf62168583fae0f3d60418c803c6 Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 7 Feb 2019 10:35:36 +0000 Subject: fsm_opt: Fix runtime error for FSMs without a reset state Signed-off-by: David Shah --- passes/fsm/fsm_opt.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'passes') diff --git a/passes/fsm/fsm_opt.cc b/passes/fsm/fsm_opt.cc index 3a6ac2746..048daee55 100644 --- a/passes/fsm/fsm_opt.cc +++ b/passes/fsm/fsm_opt.cc @@ -72,7 +72,8 @@ struct FsmOpt new_transition_table.swap(fsm_data.transition_table); new_state_table.swap(fsm_data.state_table); - fsm_data.reset_state = old_to_new_state.at(fsm_data.reset_state); + if (fsm_data.reset_state != -1) + fsm_data.reset_state = old_to_new_state.at(fsm_data.reset_state); } } -- cgit v1.2.3