3255fca993
Fix a bug in the code that analyzes how function parameters are used, which wasn't properly handling certain types of closures. The code in question has support for deriving flags for a given parameter based on whether it is passed to a call. Example: func foo(f1 func(int)) { bar(32, f1) } func bar(x int, f2 func()) { f2(x) } When analyzing "bar", we can derive the "FeedsIndirectCall" flag for parameter "f1" by virtue of the fact that it is passed directly to "bar", and bar's corresponding parameter "f2" has the flag set. For a more complex example such as func foo(f1 func(int)) func() int { return func(q int) int { <<-- HERE bar(99, f1) return q } } func bar(x int, f2 func()) { f2(x) } The heuristics code would panic when examining the closure marked above due to the fact that the call to "bar" was passing an ir.Name with class PPARAM, but no such param was present in the enclosing function. Change-Id: I30436ce716b51bfb03e42e7abe76a4514e6b9285 Reviewed-on: https://go-review.googlesource.com/c/go/+/539320 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
go.env | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.