promql/parser: Cleanup generatedParserResult accross reuse

Reusing the same generatedParserResult ends up in strange panics:
See #7131 and #7127.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto 2020-04-16 01:44:43 +02:00
parent e2c06a8898
commit 7eedcc708e

View file

@ -169,6 +169,7 @@ func newParser(input string) *parser {
p.injecting = false
p.parseErrors = nil
p.generatedParserResult = nil
// Clear lexer struct before reusing.
p.lex = Lexer{