Skip to content

Commit

Permalink
promql/parser: Cleanup generatedParserResult accross reuse
Browse files Browse the repository at this point in the history
Reusing the same generatedParserResult ends up in strange panics:
See prometheus#7131 and prometheus#7127.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
  • Loading branch information
roidelapluie committed Apr 17, 2020
1 parent e2c06a8 commit 7eedcc7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions promql/parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 7eedcc7

Please sign in to comment.