9c81402f58
The existing code uses a type map which associates a type number with a type; references to existing types are expressed via the type number in the export data. Before this CL, type map entries were set when a type was read in completely, which meant that recursive references to types (i.e., type map entries) that were in the middle of construction (i.e., where the type map was not yet updated) would lead to nil types. Such cycles are usually created via defined types which introduce a types.Named entry into the type map before the underlying type is parsed; in this case the code worked. In case of type aliases, no such "forwarder" exists and type cycles lead to nil types. This CL fixes the problem by a) updating the type map as soon as a type becomes available but before the type's components are parsed; b) keeping track of a list of type map entries that may need to be updated together (because of aliases that may all refer to the same type); and c) adding (redundant) markers to the type map to detect algorithmic errors. Also: - distinguish between parseInt and parseInt64 - added more test cases Fixes #27856. Change-Id: Iba701439ea3231aa435b7b80ea2d419db2af3be1 Reviewed-on: https://go-review.googlesource.com/137857 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
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 3.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://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.