Only methods that modify the time take pointer receivers;
IsDST does not modify it and therefore should not.
For #42102 and #46688.
Change-Id: I4721ef7f4d7572236ae6e4d99a459b9ffb11999e
Reviewed-on: https://go-review.googlesource.com/c/go/+/326789
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This ports the fix in CL 328050 for typecheck to types2.
The fix is not identical, due to code structure differences between
typecheck and types2, but the idea is the same. We only do the untyped
conversion when both operands can be mixed.
Updates #46749
Change-Id: Ib2c63ba0d5dd8bf02318b1bfdfe51dcaeeeb7f82
Reviewed-on: https://go-review.googlesource.com/c/go/+/328053
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This is a straightforward port of CL 324570 to go/types.
Change-Id: I1395775a1d21a903a57e0cefc4e240cfa2bb8e97
Reviewed-on: https://go-review.googlesource.com/c/go/+/326684
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 324571 to go/types, though type list handling is
guarded by a const rather than a config option.
Change-Id: I91c940fead048980603e0bb56fcc896dbef4f94c
Reviewed-on: https://go-review.googlesource.com/c/go/+/326683
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 324569 to go/types, with some error positions
adjusted: go/types puts errors related to terms on the '~', not type
name.
Change-Id: I92e8443ce27a5ecae0e3e0dac4811eaf3eee07ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/326682
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
This is a port of CL 324530 to go/types. One error position in
issue39634.go2 was adjusted by a character, to account for go/types'
positioning.
Change-Id: Ie06974ea9ee81d3ae66ef58dba522936ab4ce2d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/326681
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 straightforward port of CL 324529 to go/types.
Change-Id: I788b1ac3d4e40060038a134c525c81624add8e81
Reviewed-on: https://go-review.googlesource.com/c/go/+/326680
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 straightforward port of CL 323355 to go/types, adjusted for
the different error reporting API in go/types.
Change-Id: I0f9d7ca0e0959e1e214ecd61eb85cc311e6409a2
Reviewed-on: https://go-review.googlesource.com/c/go/+/326679
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 straightforward port of CL 323354 to go/types.
Change-Id: I53512540cc35df6e88b2b66e144e1be7ccc9a6f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/326678
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 straightforward port of CL 323274 to go/types.
Change-Id: Ica769d90fd482703f260f105199d2f2229498e95
Reviewed-on: https://go-review.googlesource.com/c/go/+/326677
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 321689 to go/types. It differs from that CL in the
uses of the position, AST and error APIs, and in not factoring out an
unimplemented() helper (this helper didn't already exist in go/types, so
it seemed cleaner to defer adding it).
Change-Id: I577a57297caf35eb7a23f63f3f52037a7bb528ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/326069
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
This is an approximate port of CL 321109 to go/parser, though go/parser
does not have the same internal APIs as cmd/compile/internal/syntax, so
this CL required some refactoring.
Change-Id: I146ef530c969d61bab99f98f4de94b862e103ddc
Reviewed-on: https://go-review.googlesource.com/c/go/+/325703
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 307371 to go/parser, adding support for the new
embedded type expressions. As in that CL, type lists continue to be
accepted.
This CL also revealed a pre-existing bug related to embedded instances:
the parser was failing to parse embedded instances with multiple type
arguments, due to not consuming the initial ','. This is fixed, and
along the way TestErrors is modified to use subtests.
Several missing tests cases were added to exprstring_test.go. These must
have been missed in an earlier CL.
Change-Id: I452769536998cddb1618bebdba675fc09d48a12f
Reviewed-on: https://go-review.googlesource.com/c/go/+/325690
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 an approximate port of CL 307370 to go/token and go/scanner.
Change-Id: I5b789408f825f7e39f569322cb67802117b9d734
Reviewed-on: https://go-review.googlesource.com/c/go/+/324992
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 CL removes the typeparams build constraint guarding changes to the
go/ast and go/types APIs. Notably it does not remove all indirection
added to hide the type parameter API: the go/internal/typeparams
package is not yet deleted, nor have go/parser or go/types been updated
to access type parameter data directly. This will be done in a follow-up
CL; the intent of this CL is to make it easier to support the new type
set syntax, and to experiment with different AST APIs.
Change-Id: I13ea0285752991b87b3aead1d1371e1f3f817b1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/325689
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 CL changes types2's instance hashing logic to include position
information for function-scope defined types as disambiguation. This
isn't ideal, but it worked for getting nested.go passing.
Updates #46592.
Change-Id: Id83ba0001f44af69b81260306cc8b05e44fc4f09
Reviewed-on: https://go-review.googlesource.com/c/go/+/327170
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This CL implements a few improvements to SSA devirtualization to make
it simpler and more general:
1. Change reflectdata.ITabAddr to now immediately generate the wrapper
functions and write out the itab symbol data. Previously, these were
each handled by separate phases later on.
2. Removes the hack in typecheck where we marked itabs that we
expected to need later. Instead, the calls to ITabAddr in walk now
handle generating the wrappers.
3. Changes the SSA interface call devirtualization algorithm to just
use the itab symbol data (namely, its relocations) to figure out what
pointer is available in memory at the given offset. This decouples it
somewhat from reflectdata.
Change-Id: I8fe06922af8f8a1e7c93f5aff2b60ff59b8e7114
Reviewed-on: https://go-review.googlesource.com/c/go/+/327871
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
I needed to also update TestScript/mod_sumdb_golang.
It had been relying on 'go list -mod=mod' to add both the go.mod and
go.sum entries for the named package, but when 'go get' actually adds
all of the needed dependencies, lazy loading kicks in and 'go list'
doesn't end up needing the checksums for go.mod files.
We didn't detect the skew before because the 'go list' command was
(unexpectedly) also adding the missing dependencies, which triggered a
deep scan of the complete module graph.
For #45979
Change-Id: Ica917dee22c83ffa71c6ad0f2e189f911b73edf4
Reviewed-on: https://go-review.googlesource.com/c/go/+/328231
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
In reflectdata, we have a hack to only apply inlining for (*T).M
wrappers generated around T.M. This was a hack because I didn't
understand at the time why other cases were failing.
But I understand now: during export, we generally skip exporting the
inline bodies for unexported methods (unless they're reachable through
some other exported method). But it doesn't take into account that
embedding a type requires generating wrappers for promoted methods,
including imported, unexported methods.
For example:
package a
type T struct{}
func (T) m() {} // previously omitted by exported
package b
import "./a"
type U struct { a.T } // needs U.m -> T.m wrapper
This CL adds extra logic to the crawler to recognize that T is an
exported type directly reachable by the user, so *all* of its methods
need to be re-exported.
This finally allows simplifying reflectdata.methodWrapper to always
call inline.InlineCalls.
Change-Id: I25031d41fd6b6cd69d31c6a864b5329cdb5780e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/327872
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
If someone sees "in [0,n)" it might look like a typo.
Saying "in the half-open interval [0,n)" will give people
something to search the web for (half-open interval).
Change-Id: I3c343f0a7171891e106e709ca77ab9db5daa5c84
Reviewed-on: https://go-review.googlesource.com/c/go/+/328210
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
CL 328051 introduced new syncImplicitTypes, but forgot to add a sync
after syncAddBody in linker.relocFuncExt, cause the compiler crashes
when reading in package data.
Adding missing w.sync(syncImplicitTypes) call fixes this.
While at it, also run go generate to update code generated for
syncImplicitTypes, which is also missed in CL 328051.
Change-Id: Ic65092f69f8d8e63de15989c7f15b6e5633d8f9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/328054
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Temprary revert CL 325918.
Delve relies on the _defer.fn.fn field to get defer frames.
CL 325918 changes the type of _defer.fn to func(), which no
longer has an fn field.
Change-Id: If6c71b15a27bac579593f5273c9a49715e6e35b2
Reviewed-on: https://go-review.googlesource.com/c/go/+/327775
Trust: Cherry Mui <cherryyz@google.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
On ARM64, instruction like "MOVD (R1)(R2*1), R3" is accepted and
assembles correctly with Go 1.16, but errors out on tip with
"arm64 doesn't support scaled register format", since CL 289589.
"MOVD (R1)(R2), R3" is the preferred form. But the *1 form works
before and assembles correctly. Keep supporting it.
Fixes#46766.
Change-Id: I0f7fd71fa87ea698919a936b6c68aa5a91afd486
Reviewed-on: https://go-review.googlesource.com/c/go/+/328229
Trust: Cherry Mui <cherryyz@google.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: eric fang <eric.fang@arm.com>
- test/run.go
CL 328050 added fixedbugs/issue46749.go to -G=3 excluded files list
Merge List:
+ 2021-06-16 785a8f677f cmd/compile: better error message for invalid untyped operation
+ 2021-06-16 a752bc0746 syscall: fix TestGroupCleanupUserNamespace test failure on Fedora
+ 2021-06-15 d77f4c0c5c net/http: improve some server docs
+ 2021-06-15 219fe9d547 cmd/go: ignore UTF8 BOM when reading source code
+ 2021-06-15 723f199edd cmd/link: set correct flags in .dynamic for PIE buildmode
+ 2021-06-15 4d2d89ff42 cmd/go, go/build: update docs to use //go:build syntax
+ 2021-06-15 033d885315 doc/go1.17: document go run pkg@version
+ 2021-06-15 ea8612ef42 syscall: disable c-shared test when no cgo, for windows/arm
+ 2021-06-15 abc56fd1a0 internal/bytealg: remove duplicate go:build line
+ 2021-06-15 4061d3463b syscall: rewrite handle inheritance test to use C rather than Powershell
+ 2021-06-15 cf4e3e3d3b reflect: explain why convertible or comparable types may still panic
+ 2021-06-14 7841cb14d9 doc/go1.17: assorted fixes
+ 2021-06-14 8a5a6f46dc debug/elf: don't apply DWARF relocations for ET_EXEC binaries
+ 2021-06-14 9d13f8d43e runtime: update the variable name in comment
+ 2021-06-14 0fd20ed5b6 reflect: use same conversion panic in reflect and runtime
+ 2021-06-14 6bbb0a9d4a cmd/internal/sys: mark windows/arm64 as c-shared-capable
+ 2021-06-14 d4f34f8c63 doc/go1.17: reword "results" in stack trace printing
Change-Id: I60d1f67c4d48cd4093c350fc89bd60c454d23944
The logic for handling them must keep in sync between reader/writer, so
factoring them out from addBody make it's easier to refer later.
Change-Id: I26447065867d79f4f47cc678a398b9e7bf5d2403
Reviewed-on: https://go-review.googlesource.com/c/go/+/328051
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
For typed vs un-typed operation, the compiler do the conversion
un-conditionally, so if the operation is invalid, the error report is
pointed to the conversion, instead of the invalid operation itself.
To fix this, only do the conversion when the operations are valid
for both types.
Fixes#46749
Change-Id: Ib71c7bcd3ed5454e6df55b6a8db4e0f189259ba7
Reviewed-on: https://go-review.googlesource.com/c/go/+/328050
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This CL adds a new -d=unified debug flag, which controls whether
unified IR mode is used.
Change-Id: Iaa5f3cc0a24b9881aeec5317cd6b462b4a7b6fc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/327054
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
This CL adds a new unified IR construction mode to the frontend. It's
purely additive, and all files include "UNREVIEWED" at the top, like
how types2 was initially imported. The next CL adds a -d=unified flag
to actually enable unified IR mode.
See below for more details, but some highlights:
1. It adds ~6kloc (excluding enum listings and stringer output), but I
estimate it will allow removing ~14kloc (see CL 324670, including its
commit message);
2. When enabled by default, it passes more tests than -G=3 does (see
CL 325213 and CL 324673);
3. Without requiring any new code, it supports inlining of more code
than the current inliner (see CL 324574; contrast CL 283112 and CL
266203, which added support for inlining function literals and type
switches, respectively);
4. Aside from dictionaries (which I intend to add still), its support
for generics is more complete (e.g., it fully supports local types,
including local generic types within generic functions and
instantiating generic types with local types; see
test/typeparam/nested.go);
5. It supports lazy loading of types and objects for types2 type
checking;
6. It supports re-exporting of types, objects, and inline bodies
without needing to parse them into IR;
7. The new export data format has extensive support for debugging with
"sync" markers, so mistakes during development are easier to catch;
8. When compiling with -d=inlfuncswithclosures=0, it enables "quirks
mode" where it generates output that passes toolstash -cmp.
--
The new unified IR pipeline combines noding, stenciling, inlining, and
import/export into a single, shared code path. Previously, IR trees
went through multiple phases of copying during compilation:
1. "Noding": the syntax AST is copied into the initial IR form. To
support generics, there's now also "irgen", which implements the same
idea, but takes advantage of types2 type-checking results to more
directly construct IR.
2. "Stenciling": generic IR forms are copied into instantiated IR
forms, substituting type parameters as appropriate.
3. "Inlining": the inliner made backup copies of inlinable functions,
and then copied them again when inlining into a call site, with some
modifications (e.g., updating position information, rewriting variable
references, changing "return" statements into "goto").
4. "Importing/exporting": the exporter wrote out the IR as saved by
the inliner, and then the importer read it back as to be used by the
inliner again. Normal functions are imported/exported "desugared",
while generic functions are imported/exported in source form.
These passes are all conceptually the same thing: make a copy of a
function body, maybe with some minor changes/substitutions. However,
they're all completely separate implementations that frequently run
into the same issues because IR has many nuanced corner cases.
For example, inlining currently doesn't support local defined types,
"range" loops, or labeled "for"/"switch" statements, because these
require special handling around Sym references. We've recently
extended the inliner to support new features like inlining type
switches and function literals, and they've had issues. The exporter
only knows how to export from IR form, so when re-exporting inlinable
functions (e.g., methods on imported types that are exposed via
exported APIs), these functions may need to be imported as IR for the
sole purpose of being immediately exported back out again.
By unifying all of these modes of copying into a single code path that
cleanly separates concerns, we eliminate many of these possible
issues. Some recent examples:
1. Issues #45743 and #46472 were issues where type switches were
mishandled by inlining and stenciling, respectively; but neither of
these affected unified IR, because it constructs type switches using
the exact same code as for normal functions.
2. CL 325409 fixes an issue in stenciling with implicit conversion of
values of type-parameter type to variables of interface type, but this
issue did not affect unified IR.
Change-Id: I5a05991fe16d68bb0f712503e034cb9f2d19e296
Reviewed-on: https://go-review.googlesource.com/c/go/+/324573
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Fix the problem that UTF8 BOM can cause the parsing of import path and directives to fail.
Fixes#46198Fixes#46290Fixes#35726
Change-Id: I2d9995ee82b094bcfa5583f0cb4e8547cb973077
GitHub-Last-Rev: 98abf91377
GitHub-Pull-Request: golang/go#46643
Reviewed-on: https://go-review.googlesource.com/c/go/+/325990
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
For internal linking, when generating a PIE binary, set the proper
.dynamic section flags to mark the binary as position-independent.
Fixes#46747.
Change-Id: I2b899148c6d06f92c9d12257a9761278b4236dfc
Reviewed-on: https://go-review.googlesource.com/c/go/+/328089
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
The windows/arm port does not yet support cgo, so disable a test that
requires it. This fixes a regression from CL 327969, which added support
for arm64, but errantly dropped the t.Skip for both arm and arm64,
rather than just for arm64. With this commit, we make the test specific
to cgo, rather than the architecture.
Change-Id: Ibe1166c1965e007c7af899b07ded65f2a2633ddd
Reviewed-on: https://go-review.googlesource.com/c/go/+/327970
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
In CL 327210, we disabled this test on arm platforms, because the
powershell shipped with those systems isn't native, which means it'd
refuse to load native DLLs. This commit rewrites the test to simply not
use Powershell, and instead compiles a trivial C program that tests for
the same thing. Reverting CL 316269 makes this test fail, as desired,
while applying it makes this test succeed.
Fixes#46701
Change-Id: If39612c57bf74c63adf58e2c49b5cb739b461fe5
Reviewed-on: https://go-review.googlesource.com/c/go/+/327969
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Conversions of slices to arrays may panic since the slice is too short.
Comparibility of interfaces may panic since the underlying value is incomparable.
This is a follow-up to CL 301652
Change-Id: Ia5d84a6e556a7b82c39add4be93ed7463e63cc8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/327589
Trust: Joe Tsai <joetsai@digital-static.net>
Trust: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Some ET_EXEC binaries might have relocations for non-loadable sections
like .debug_info. These relocations must not be applied, because:
* They may be incorrect
* The correct relocations were already applied at link time
Binaries in Linux Kernel debug packages like Fedora/Centos kernel-debuginfo
are such examples. Relocations for .debug_* sections are included in the
final binaries because they are compiled with --emit-relocs, but the resulting
relocations are incorrect and shouldn't be used when reading DWARF sections.
Fixes#46673
Change-Id: I2b4214f1584bfc243446d0eaee41512657325b95
GitHub-Last-Rev: 8350fad059
GitHub-Pull-Request: golang/go#46698
Reviewed-on: https://go-review.googlesource.com/c/go/+/327009
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 Mui <cherryyz@google.com>
The comment use allg to refer to allgs in code. Update the comment to
use the same variable name.
Change-Id: Id059fce7846776737fb038b86bcf8765a4a7c9c0
GitHub-Last-Rev: 234fb0a208
GitHub-Pull-Request: golang/go#46723
Reviewed-on: https://go-review.googlesource.com/c/go/+/327629
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Consistently say "pointer to array", not "array pointer".
Fixes#46743
Change-Id: I2388ec5c16f96e82a3a383b9b462b350686ddc5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/327870
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
The platform supports c-shared now, so flip this on. I've given this a
small smoke test using [1], and it was able to pass packets and
generally function well. Since [1] uses quite a bit of Go functionality
under the hood, I think it's a decent test that a lot of things that
should be working are working. So this commit enables it.
[1] https://git.zx2c4.com/wireguard-windows/about/embeddable-dll-service/README.md
Updates #46502.
Change-Id: I5c771d033bd20e5ce472c315d7c207bbc1020b4a
Reviewed-on: https://go-review.googlesource.com/c/go/+/326310
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Two non-conflict changes included because they're needed for all.bash:
1. Bump internal/goversion.Version to 18. This will happen eventually
anyway (dev.typeparams will not be merged back to Go 1.17), and is
needed for cmd/api to allow new API additions.
2. Add fixedbugs/issue46725.go (new test added on master) to the list
of known failures for -G=3. This test exercises a bug that was fixed
in typecheck, but -G=3 mode has duplicated that code and will need to
be fixed as well. That's outside of the scope of a merge.
Conflicts:
- src/runtime/traceback.go
Nearby lines were removed on both master and dev.typeparams.
Merge List:
+ 2021-06-14 fdab5be159 doc/go1.17: further revise OpenBSD release notes
+ 2021-06-14 326ea438bb cmd/compile: rewrite a, b = f() to use temporaries when type not identical
+ 2021-06-14 3249b645c9 cmd/compile: factor out rewrite multi-valued f()
+ 2021-06-13 14305bf0b9 misc/cgo: generate Windows import libraries for clang
+ 2021-06-13 24cff0f044 cmd/go, misc/cgo: skip test if no .edata
+ 2021-06-13 67b1b6a2e3 cmd/compile: allow ir.OSLICE2ARRPTR in mayCall
+ 2021-06-12 1ed0d129e9 runtime: testprogcgo: don't call exported Go functions directly from Go
+ 2021-06-12 9d46ee5ac4 reflect: handle stack-to-register translation in callMethod
+ 2021-06-11 e552a6d312 cmd/go: remove hint when no module is suggested
+ 2021-06-11 16b5d766d8 syscall: do not load native libraries on non-native powershell on arm
+ 2021-06-11 77aa209b38 runtime: loop on EINTR in macOS sigNoteSleep
+ 2021-06-11 e2dc6dd5c9 doc/go1.17: clean up formatting of gofmt section
+ 2021-06-11 2f1128461d cmd/go: match Windows paths in TestScript/mod_invalid_version
+ 2021-06-11 2721da2608 doc/go1.17: fix formatting near httptest
+ 2021-06-10 770f1de8c5 net/http: remove test-only private key from production binaries
+ 2021-06-10 8d11b1d117 cmd/go: report the imports of CompiledGoFiles in ImportMap
+ 2021-06-10 dc00dc6c6b crypto/tls: let HTTP/1.1 clients connect to servers with NextProtos "h2"
+ 2021-06-09 27f83723e9 api: promote next to go1.17
+ 2021-06-09 182157c81a doc/go1.17: remove lingering TODO
+ 2021-06-09 a5bc060b42 doc/go1.17: document strconv changes for Go 1.17
+ 2021-06-09 1402b27d46 strconv: document parsing of leading +/-
+ 2021-06-09 df35ade067 doc/go1.17: document //go:build lines
+ 2021-06-09 e4e7807d24 net/http: add AllowQuerySemicolons
+ 2021-06-09 ec3026d032 doc/go1.17: remove TODO for ports section
+ 2021-06-09 e6dda19888 net/url: reject query values with semicolons
+ 2021-06-09 139e935d3c math/big: comment division
+ 2021-06-09 aa5540cd82 cmd/compile: make map.zero symbol content-addressable
+ 2021-06-09 07ca28d529 cmd/link: fix bug in -strictdups checking of BSS symbols
+ 2021-06-08 bcecae2af6 doc/go1.17: mention new possibility of type conversion panicking
+ 2021-06-08 63dcab2e91 doc/go1.17: mention new vet checks sigchanyzer and stdmethods.
+ 2021-06-08 6551763a60 doc/go1.17: mention block profile bias fix
+ 2021-06-08 cb80937bf6 Revert "doc/go1.17: mention block profile bias fix"
+ 2021-06-08 d3e3d03666 net: reject leading zeros in IP address parsers
+ 2021-06-08 da4a640141 doc/go1.17: revise OpenBSD release notes
+ 2021-06-08 689f4c7415 doc/go1.17: mention block profile bias fix
+ 2021-06-08 9afe071c60 doc/go1.17: remove TODO for Tools section
+ 2021-06-08 f753d7223e doc/go1.17: resolve TODO for cmd/cover
+ 2021-06-08 9498b0155d cmd/go: in Go 1.17+ modules, add indirect go.mod dependencies separately from direct ones
+ 2021-06-08 949f00cebe doc/go1.17: add release notes for crypto packages
+ 2021-06-08 0fb3e2c184 doc/go1.17: add a release note for the '-compat' flag to 'go mod tidy'
+ 2021-06-08 2169deb352 cmd/compile: use t.AllMethods when sorting typesByString
+ 2021-06-08 c20bcb6488 runtime: remove out-of-date comments about frame skipping
+ 2021-06-07 39c39ae52f doc: document Go 1.17 language changes
+ 2021-06-07 dc8b558951 cmd/dist: pass -Wno-lto-type-mismatch in swig_callback_lto
+ 2021-06-07 909dd5e010 strconv: ParseFloat: always return ErrSyntax for bad syntax
Change-Id: Iffdf379d0275bbd12d50149ce38634773ced481d
"Results" may sound like the results from the previous sentence.
Reword to "function return values" for clarity.
Suggested by Tobias Kohlbau.
Change-Id: Ie78df36b5b191b06e98b802f9a46db6d067a8ea0
Reviewed-on: https://go-review.googlesource.com/c/go/+/327774
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Tobias Kohlbau <tobias@kohlbau.de>
Simplify and remove forward-compatibility reference, as OpenBSD 6.9 has
already been released (1st of May 2021).
Updates #44513
Change-Id: I0a1abbb397f31d15c80a970edaa9723f894cafa9
Reviewed-on: https://go-review.googlesource.com/c/go/+/327652
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
If any of the LHS expressions of an OAS2FUNC are not identical to the
respective function call results, escape analysis mishandles the
implicit conversion, causes memory corruption.
Instead, we should insert autotmps like we already do for f(g()) calls
and return g() statements.
Fixes#46725
Change-Id: I71a08da0bf1a03d09a023da5b6f78fb37a4a4690
Reviewed-on: https://go-review.googlesource.com/c/go/+/327651
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
So next CL can reuse code to rewrite OAS2FUNC.
Passes toolstash -cmp.
For #46725
Change-Id: I1113ed615b6d6b9494dd87000ce342d7a46d9e7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/327650
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>