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 386aea7774
commit 1f6f8e60ee
1 changed files with 1 additions and 0 deletions

View File

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