Add respective check to type checker.
Remove respective check from the compiler's new type2-based noder.
Updates #31793.
Change-Id: I907e3acab4c136027a8c3db1e9bac301d209c2e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/289570
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This enables another test.
Change-Id: I80763b97d939e225158a083299b2e0d189268bc7
Reviewed-on: https://go-review.googlesource.com/c/go/+/289569
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
Add the Config.Lang field which may be set to a Go version string,
such as "go1.12". This is a string rather than explicit semantic
version numbers (such as {1, 12}) for API robustness; a string
is more flexible should we need more or different information.
Add -lang flag to types2 package for use with (manual) testing
when running "go test -run Check$ -lang=... -files=...".
While changing flags, look for comma-separated (rather than space-
separated) files when providing the -file flag.
Check that numeric constant literals, signed shift counts are
accepted according to the selected language version.
Type alias declarations and overlapping embedded interfaces are
not yet checked.
Updates #31793.
Change-Id: I9ff238ed38a88f377eb2267dc3e8816b89a40635
Reviewed-on: https://go-review.googlesource.com/c/go/+/289509
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This matches the compiler's existing limitations and thus ensures
that types2 reports the same errors for oversize integer constants.
Change-Id: I4fb7c83f3af69098d96f7b6c53dbe3eaf6ea9ee4
Reviewed-on: https://go-review.googlesource.com/c/go/+/288633
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This is a port of CL 279424, which didn't make it into master in time
for go1.16. Move it to dev.regabi so that it may be merged.
Notably, this port no longer removes the _InvalidInitSig error code,
instead opting to deprecate it. Now that error codes are 'locked in' for
go1.16, even if their API may not yet be exposed, we should follow the
practice of not changing their values. In the future, code generation
can make it easier to keep error code values constant.
For #43308
Change-Id: I5260b93fd063393d38d6458e45a67e7f9b7426ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/289714
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Symbol's Attributes and ABI are in the same word. In the
concurrent backend, we may read one symbol's ABI (the callee)
while setting its attributes in another goroutine.
Fix racecompile build.
Change-Id: I500e869bafdd72080119ab243db94eee3afcf926
Reviewed-on: https://go-review.googlesource.com/c/go/+/289290
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
On the dev.typeparams and dev.go2go branches, check_test.go has been
updated to automatically discover test data. This is convenient, so port
it to dev.regabi.
Change-Id: I5da9a9a5139c35a2693e64364eb9928ece1cd7c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/289713
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This is a port of CL 274615, adapted to go/types. The only change was in
the positioning of expected errors in vardecl.src: in go/types they are
positioned on the identifier.
Change-Id: Iab03265a7c4287749373e4380c6db6a95f262f30
Reviewed-on: https://go-review.googlesource.com/c/go/+/289712
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
errors_test.go was missed during merging. Add it.
Change-Id: I321f08ae16ca02586875e1c7776f5d78f8690b4d
Reviewed-on: https://go-review.googlesource.com/c/go/+/289549
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
In ABIInternal, reserve X15 as constant zero, and use it to zero
memory. (Maybe there can be more use of it?)
The register is zeroed when transition to ABIInternal from ABI0.
Caveat: using X15 generates longer instructions than using X0.
Maybe we want to use X0?
Change-Id: I12d5ee92a01fc0b59dad4e5ab023ac71bc2a8b7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/288093
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Mark the syscall wrappers as ABIInternal, as they have addresses
taken from Go code, and it is important to call to them without
wrappers.
Previously, the wrapper is just a single JMP instruction, which
makes it not matter. In the next CL we'll make the wrapper
actually have a frame. The real wrappers will mess up things
such as stack alignment for C ABI.
This doesn't look really nice, but I don't know how we can do
better...
TODO: other OSes.
Change-Id: Ifb3920494990a7775e3e6902fbcaf137df3cc653
Reviewed-on: https://go-review.googlesource.com/c/go/+/288092
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Change-Id: I6290bc4921ef17586b5028d3f40a88372b175014
Reviewed-on: https://go-review.googlesource.com/c/go/+/289269
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
The compiler uses 512 bit of precision for untyped constant
arithmetic but didn't restrict the length of incoming constant
literals in any way, possibly opening the door for excessively
long constants that could bring compilation to a crawl.
Add a simple check that refuses excessively long constants.
Add test.
Change-Id: I797cb2a8e677b8da2864eb92d686d271ab8a004d
Reviewed-on: https://go-review.googlesource.com/c/go/+/289049
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
These newly enabled (not anymore excluded) tests pass now
that we run in -G=3 mode when using the new types2 based
noder.
Change-Id: I5e7304c8020f394b79737d67c750bebbe02bd502
Reviewed-on: https://go-review.googlesource.com/c/go/+/289109
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
There appears to be a typo in the description of
the recursive division algorithm.
Two things seem suspicious with the original comment:
1. It is talking about choosing s, but s doesn't
appear anywhere in the equation.
2. The math in the equation is incorrect.
Where
B = len(v)/2
s = B - 1
Proof that it is incorrect:
len(v) - B >= B + 1
len(v) - len(v)/2 >= len(v)/2 + 1
This doesn't hold if len(v) is even, e.g. 10:
10 - 10/2 >= 10/2 + 1
10 - 5 >= 5 + 1
5 >= 6 // this is false
The new equation will be the following,
which will be mathematically correct:
len(v) - s >= B + 1
len(v) - (len(v)/2 - 1) >= len(v)/2 + 1
len(v) - len(v)/2 + 1 >= len(v)/2 + 1
len(v) - len(v)/2 >= len(v)/2
This holds if len(v) is even or odd.
e.g. 10
10 - 10/2 >= 10/2
10 - 5 >= 5
5 >= 5
e.g. 11
11 - 11/2 >= 11/2
11 - 5 >= 5
6 >= 5
Change-Id: If77ce09286cf7038637b5dfd0fb7d4f828023f56
Reviewed-on: https://go-review.googlesource.com/c/go/+/287372
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Trust: Katie Hockman <katie@golang.org>
The compiler chooses the literal value export format by type
not by constant.Kind. That is, a floating-point constant is
always exported as a (big) float value, not a (big) rational
value, even though the internal representation may be that
of a rational number. (This is a possibility now that the
compiler also uses the go/constant package.)
Naturally, during import, a floating-point value is read as
a float and represented as a (big) float in go/constant.
The types2 importer (based on the go/types importer) read
the floating-point number elements (mantissa, exponent) but
then constructed the float go/constant value through a series
of elementary operations, typically leading to a rational,
but sometimes even an integer number (e.g. for math.MaxFloat64).
There is no problem with that (the value is the same) but if
we want to impose bitsize limits on overlarge integer values
we quickly run into trouble with large floats represented as
integers.
This change matches the code importing float literals with
the code used by the compiler.
Note: At some point we may want to relax the import/export code
for constant values and export them by representation rather than
by type. As is, we lose accuracy since all floating-point point
values, even the ones internally represented as rational numbers
end up being exported as floating-point numbers.
Change-Id: Ic751b2046a0fd047f751da3d35cbef0a1b5fea3e
Reviewed-on: https://go-review.googlesource.com/c/go/+/288632
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Create an extra OFUNCINST node as needed, if there are inferred type
arguments for a generic function call.
Change-Id: Id990c5bcbce2893377072a7e41c7c6785d1eab60
Reviewed-on: https://go-review.googlesource.com/c/go/+/288952
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Expresses things more clearly, especially in cases like 'f := min[int]'
where we create a xsgeneric function instantiation, but don't immediately
call it.
min[int](2, 3) now looks like:
. CALLFUNC tc(1) Use:1 int # min1.go:11 int
. . FUNCINST tc(1) FUNC-func(int, int) int # min1.go:11 FUNC-func(int, int) int
. . . NAME-main.min tc(1) Class:PFUNC Offset:0 Used FUNC-func[T](T, T) T # min1.go:3
. . FUNCINST-Targs
. . . TYPE .int Offset:0 type int
. CALLFUNC-Args
. . LITERAL-2 tc(1) int # min1.go:11
. . LITERAL-3 tc(1) int # min1.go:11
Remove the targs parameter from ir.NewCallExpr(), not needed anymore,
since type arguments are included in the FUNCINST.
Change-Id: I23438b75288330475294d7ace239ba64acfa641e
Reviewed-on: https://go-review.googlesource.com/c/go/+/288951
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Will now run "go tool compile -G=2 -W=2" on a simple generic function
with multiple type parameters and a call to that function with multiple
explicit type arguments.
We will likely move to have a separate function/type instantiation node,
in order distinguish these cases from normal index expressions.
Change-Id: I0a571902d63785cc06240ed4ba0495923403b511
Reviewed-on: https://go-review.googlesource.com/c/go/+/288433
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
The example, var v, ok T1 = x.(T), can be interpreted as type T1 interface{} or type T = bool; type T1 = T.
Separating the example would help understanding for readers.
Change-Id: I179f4564e67f4d503815d29307df2cebb50c82f9
GitHub-Last-Rev: b34fffb6bb
GitHub-Pull-Request: golang/go#44040
Reviewed-on: https://go-review.googlesource.com/c/go/+/288472
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Robert Griesemer <gri@golang.org>
In the linker's deadcode pass we decode type symbols for
interface satisfaction analysis. When linking against Go shared
libraries, the type symbol may come from a shared library, so it
doesn't have data in the current module being linked, so we cannot
decode it. We already have code to skip DYNIMPORT symbols. However,
this doesn't actually work, because at that point the type symbols'
names haven't been mangled, whereas they may be mangled in the
shared library. So the symbol definition (in shared library) and
reference (in current module) haven't been connected.
Skip decoding type symbols of type Sxxx (along with DYNIMPORT)
when linkShared.
Note: we cannot skip all type symbols, as we still need to mark
unexported methods defined in the current module.
Fixes#44031.
Change-Id: I833d19a060c94edbd6fc448172358f9a7d760657
Reviewed-on: https://go-review.googlesource.com/c/go/+/288496
Trust: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
We want to find a section that contains addr. sect.Addr+sect.Size
is the exclusive upper bound.
Change-Id: If2cd6bdd6e03174680e066189b0f4bf9e2ba6630
Reviewed-on: https://go-review.googlesource.com/c/go/+/288592
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Will now run "go tool compile -G=2 -W=2" on a simple generic function
with one type parameter and a call to that function with one explicit
type argument. Next change will handle multiple type arguments.
Change-Id: Ia7d17ea2a02bf99bd50e673ac80ae4aad4c48440
Reviewed-on: https://go-review.googlesource.com/c/go/+/288432
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
CL 279423 introduced a regression in this test as it incorrectly laid
out various instructions. In the case of arm, the second instruction
was overwriting the first. In the case of 386, amd64 and s390x, the
instructions were being appended to the end of the slice after 64
zero bytes.
This was causing test failures on "linux/s390x on z13".
Fixes#44028
Change-Id: Id136212dabdae27db7e91904b0df6a3a9d2f4af4
Reviewed-on: https://go-review.googlesource.com/c/go/+/288278
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Add a test case for issue 43818. We don't want to mark as inlinable a
function with a closure that has an operation (such as OSELRECV2) that
we don't currently support for exporting. This test case fails to
compile without the fix for #43818.
Updates #43818
Change-Id: Ief322a14aefaefc6913c40a6b8505214bd622fda
Reviewed-on: https://go-review.googlesource.com/c/go/+/288392
Run-TryBot: Dan Scales <danscales@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
With CGO disabled, the test throws the following error:
elf_test.go:291: # command-line-arguments
loadinternal: cannot find runtime/cgo
Change-Id: Iaeb183562ab637c714240b49e73078bdb791b35b
GitHub-Last-Rev: f8fe9afad5
GitHub-Pull-Request: golang/go#43911
Reviewed-on: https://go-review.googlesource.com/c/go/+/286632
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Also, make some fmt changes so that the type parameters and the
typeparam type are displayed in -W=2.
You can now parse a simple generic function (but not generic calls or generic
types) and print out the noder IR via 'go tool compile -G=2 -W=2 func.go'
Change-Id: I1f070fc4a96174a447763ad37999e61c25905901
Reviewed-on: https://go-review.googlesource.com/c/go/+/287833
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Factor out the existing "constant representation" check after
untyped constant arithmetic and combine with an overflow check.
Use a better heuristic for determining the error position if we
know the error is for a constant operand that is the result of an
arithmetic expression.
Related cleanups.
With this change, untyped constant arithmetic reports an error
when (integer) constants become too large (> 2048 bits). Before,
such arithmetic was only limited by space and time.
Change-Id: Id3cea66c8ba697ff4c7fd1e848f350d9713e3c75
Reviewed-on: https://go-review.googlesource.com/c/go/+/287832
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
//go:embed variables can be type aliases.
//go:embed variables can't be local to a function.
For #43216
For #43602Fixes#43978
Change-Id: Ib1d104dfa32b97c91d8bfc5ed5d461ca14da188f
Reviewed-on: https://go-review.googlesource.com/c/go/+/288072
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
memclrNoHeapPointers is the underlying implementation of
typedmemclr and memclrHasPointers, so it still needs to write
pointer-aligned words atomically. Document this requirement.
Updates #41428.
Change-Id: Ice00dee5de7a96a50e51ff019fcef069e8a8406a
Reviewed-on: https://go-review.googlesource.com/c/go/+/287692
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Even though builtin.go is generated, there's no need for
it to be so huge in terms code size. Nor does ultimate
speed matter here.
Added two simple helper functions that are not inlined,
which reduce the amount of code generated for this file
from 77881 bytes to 27641 bytes of assembly (per compiler
-S output) and reduce the compile binary by ~140KiB
(of course that's insignificant given the 22MiB file size).
Change-Id: I3058ec62788b33eaeff2f9d5fe975b8e41cbf172
Reviewed-on: https://go-review.googlesource.com/c/go/+/287772
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
We are focusing on generic functions first, and ignoring type lists for
now.
The signatures of types.NewSignature() and ir.NewCallExpr() changed (with
addition of type args/params).
Change-Id: I57480be3d1f65690b2946e15dd74929bf42873f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/287416
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Rather than hand rolling readlen and writelen, move it to being generated
via mksyscall.pl, as is done for most other functions.
Updates #36435
Change-Id: I649aed7b182b41c8639686feae25ce19dab812c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/287532
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This call was changed to os.ReadFile in CL 266365, but the test also
builds that source file using gccgo if present, and released versions
of gccgo do not yet support ioutil.ReadFile.
Manually tested with gccgo gccgo 10.2.1 (see #35786).
Fixes#43974.
Updates #42026.
Change-Id: Ic4ca0848d3ca324e2ab10fd14ad867f21e0898e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/287613
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This makes the respective files match the respective go/types files
a tad more.
Change-Id: Ie555e18ed23c493379a1e56b96276867190106f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/287492
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
The syscall10/syscall10X implementation uses an incorrect stack offset for
arguments a7 to a10. Correct this so that the syscall arguments work as
intended.
Updates #36435Fixes#43927
Change-Id: Ia7ae6cc8c89f50acfd951c0f271f3b3309934499
Reviewed-on: https://go-review.googlesource.com/c/go/+/287252
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
For #40700
For #41184Fixes#43957
Change-Id: Ia346f4cf160431b721efeba7dc5f1fb8814efd95
Reviewed-on: https://go-review.googlesource.com/c/go/+/287472
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Convert the syscall package on openbsd/arm64 to use libc rather than performing
direct system calls.
Updates #36435
Change-Id: I7e1da8537cea9ed9bf2676f181e56ae99383333f
Reviewed-on: https://go-review.googlesource.com/c/go/+/286815
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Replace nested function spaghetti with state object and methods.
Still somewhat complex, but a bit more explicit.
Change-Id: I21987c8e4be75821faa5a248af05d2095cdfb0d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/287132
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
When people want deterministic/single-process builds, they probably
assume that GOMAXPROCS=1 will do that. It currently does not,
neither for build parallelism nor for compiler internal parallelism.
(Current incantation for that is "go build -p=1 -gcflags=all=-c=1 ... ")
This CL makes
"GOMAXPROCS=1 go build ..."
behave like
"go build -p=1 -gcflags=all=-c=1 ... "
RELNOTE=yes
Change-Id: I9cfe50b7deee7334d2f1057b58385f6c98547b9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/284695
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
These APIs were added in CL 240604 as part of an approved proposal. It
was submitted after the initial api/go1.16.txt creation.
For #41184
For #43407
Change-Id: Ifb54df2b61c554c32bd9d17afbb74f4e42e0b228
Reviewed-on: https://go-review.googlesource.com/c/go/+/287412
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Removes the KeyUsage field that was missed in the rollback in
CL 281235.
Also updates CreateCertificateRequest to reflect that these fields
were removed.
For #43407.
Updates #43477.
Updates #37172.
Change-Id: I6244aed4a3ef3c2460c38af5511e5c2e82546179
Reviewed-on: https://go-review.googlesource.com/c/go/+/287392
Trust: Alexander Rakoczy <alex@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
We add entries to the defer list at panic/goexit time on-the-fly for
frames with open-coded defers. We do this so that we can correctly
process open-coded defers and non-open-coded defers in the correct order
during panics/goexits. But we need to remove entries for open-coded
defers from the defer list when there is a recover, since those entries
may never get removed otherwise and will get stale, since their
corresponding defers may now be processed normally (inline).
This bug here is that we were only removing higher-up stale entries
during a recover if all defers in the current frame were done. But we
could have more defers in the current frame (as the new test case
shows). In this case, we need to leave the current defer entry around
for use by deferreturn, but still remove any stale entries further along
the chain.
For bug 43921, simple change that we should abort the removal loop for
any defer entry that is started (i.e. in process by a still
not-recovered outer panic), even if it is not an open-coded defer.
This change does not fix bug 43920, which looks to be a more complex fix.
Fixes#43882Fixes#43921
Change-Id: Ie05b2fa26973aa26b25c8899a2abc916090ee4f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/286712
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
1) Rather than map-iterate through all file scopes and collect unused
packages, collect all imports in the Checker.imports list so that
errors are reported in source order.
2) From cmd/compile, borrow the idea of a "dotImportRefs" map to map
dot-imported objects to the package they were dot-imported through
(we call the map "dotImportMap").
3) From cmd/compile, borrow the "pkgnotused" function
(called Checker.errorUnusedPkg in this code) and clean up
unused package error reporting.
4) Adjust unused package error message to match compiler message exactly.
5) Enable one more excluded test case in test/run.go.
Change-Id: I4e4e55512a6043a7fd54f576c7441e3dd4077d6f
Reviewed-on: https://go-review.googlesource.com/c/go/+/287072
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>