From: David Shah Date: Thu, 7 Feb 2019 10:35:36 +0000 (+0000) Subject: fsm_opt: Fix runtime error for FSMs without a reset state X-Git-Tag: yosys-0.9~317^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4515712cb4ebf62168583fae0f3d60418c803c6;p=yosys.git fsm_opt: Fix runtime error for FSMs without a reset state Signed-off-by: David Shah --- 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); } }