From e99022e05359e5426de0288cc7a07f9882e3a1e0 Mon Sep 17 00:00:00 2001 From: "Jim.Idle" Date: Mon, 15 Aug 2022 13:46:28 +0800 Subject: [PATCH] fix: #3718 Correct DFAState index in Lexer ATN Simulator Signed-off-by: Jim.Idle --- runtime/Go/antlr/lexer_atn_simulator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/Go/antlr/lexer_atn_simulator.go b/runtime/Go/antlr/lexer_atn_simulator.go index a356893796..8906d02e6f 100644 --- a/runtime/Go/antlr/lexer_atn_simulator.go +++ b/runtime/Go/antlr/lexer_atn_simulator.go @@ -606,7 +606,7 @@ func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet, suppressEdge bool) // The proposed state has already been added to the DFA. We still have the pointer, so // we can modify it even though it is stored already. // - proposed.stateNumber = dfa.states.Len() + proposed.stateNumber = dfa.states.Len() - 1 configs.SetReadOnly(true) proposed.configs = configs }