golang/src/go/ast
Rob Findley 6a05055780 go/ast: fix bug handling the result of yield in Preorder
Once yield returns false, ast.Preorder must not call yield on any more
nodes. Even after the function passed to ast.Inspect returns false, it
may be invoked again with a non-nil node. Therefore, we must explicitly
truncate the inspection.

For #66339

Change-Id: I2b01e4e96a2d7aca785467c15ab59da13208c161
Reviewed-on: https://go-review.googlesource.com/c/go/+/585520
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-16 16:34:10 +00:00
..
ast.go go/ast: more godoc links 2024-03-28 21:32:41 +00:00
ast_test.go go/ast, go/printer: recognize export and extern line directives 2022-04-11 22:03:44 +00:00
commentmap.go go: add available godoc link 2023-10-19 12:02:03 +00:00
commentmap_test.go go/ast: use strings.Builder 2022-09-09 15:35:30 +00:00
example_test.go go/ast: add Preorder go1.23 iterator 2024-05-15 21:44:50 +00:00
filter.go go: add available godoc link 2023-10-19 12:02:03 +00:00
filter_test.go go/ast: use strings.Builder 2022-09-09 15:35:30 +00:00
import.go go/ast: fix SortImports to handle block comments (take 2) 2019-10-28 23:33:26 +00:00
issues_test.go go/ast: add IsGenerated(*File) predicate 2023-04-25 13:57:33 +00:00
print.go go/ast: more godoc links 2024-03-28 21:32:41 +00:00
print_test.go go/ast: use strings.Builder 2022-09-09 15:35:30 +00:00
resolve.go go: add available godoc link 2023-10-19 12:02:03 +00:00
scope.go go/ast: more godoc links 2024-03-28 21:32:41 +00:00
walk.go go/ast: fix bug handling the result of yield in Preorder 2024-05-16 16:34:10 +00:00
walk_test.go go/ast: fix bug handling the result of yield in Preorder 2024-05-16 16:34:10 +00:00