]> Cypherpunks repositories - gostls13.git/commit
go/parser: add *ast.BlockStmt depth test
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Thu, 20 Mar 2025 08:12:17 +0000 (09:12 +0100)
committerGopher Robot <gobot@golang.org>
Thu, 20 Mar 2025 15:38:53 +0000 (08:38 -0700)
commit19b6f0116181c4dfbb21b82f7527383337666069
tree53b4f515c20514bc037816a7fc8a0a851f71452e
parent02014706f012a90bcd48025200d28e471dd96e09
go/parser: add *ast.BlockStmt depth test

At first glance i have thought that we do not handle such case properly,
because parseBlockStmt and parseStmtList do not call call the
incNestLev. Fortunately parseStmt does, so it is detected properly.

As we don't have a test case directly for blockstmts only, i think it is
worth adding one.

Change-Id: If149b86fd90a7ee4a33c861070d1bafdd40e98ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/659455
Reviewed-by: Roland Shoemaker <roland@golang.org>
Commit-Queue: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
src/go/parser/parser_test.go