From 503c08cfc1193927a873d5188513c1dcc0d55843 Mon Sep 17 00:00:00 2001 From: Matt Willer Date: Thu, 10 Feb 2022 23:36:03 -0800 Subject: [PATCH 1/2] Fix bail error strategy nil interface panic --- runtime/Go/antlr/error_strategy.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/Go/antlr/error_strategy.go b/runtime/Go/antlr/error_strategy.go index 977a6e4549..debf4b0bd4 100644 --- a/runtime/Go/antlr/error_strategy.go +++ b/runtime/Go/antlr/error_strategy.go @@ -738,7 +738,11 @@ func (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) { context := recognizer.GetParserRuleContext() for context != nil { context.SetException(e) - context = context.GetParent().(ParserRuleContext) + if parent, ok := context.GetParent().(ParserRuleContext); ok { + context = parent + } else { + context = nil + } } panic(NewParseCancellationException()) // TODO we don't emit e properly } From 7dc5366d8edb3ffe4b2e8e075b30edcdbd138d42 Mon Sep 17 00:00:00 2001 From: Matt Willer Date: Thu, 10 Feb 2022 23:38:04 -0800 Subject: [PATCH 2/2] Add to contributors file --- contributors.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contributors.txt b/contributors.txt index ccd9304934..ac3f69f904 100644 --- a/contributors.txt +++ b/contributors.txt @@ -318,4 +318,5 @@ YYYY/MM/DD, github id, Full name, email 2021/09/23, skalt, Steven Kalt, kalt.steven@gmail.com 2021/10/10, tools4origins, Erwan Guyomarc'h, contact@erwan-guyomarch.fr 2021/10/19, jcking, Justin King, jcking@google.com -2021/10/31, skef, Skef Iterum, github@skef.org \ No newline at end of file +2021/10/31, skef, Skef Iterum, github@skef.org +2022/02/10, mattwiller, Matt Willer, matt.r.willer@gmail.com \ No newline at end of file