aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-05-11mime/multipart: fix ReadForm always return (nil,io.EOF)ms-fix-multipart-readformShulhan
Previously, the condition err == io.EOF in readForm will never true and break; it always goes to the second condition, err != nil, which cause the returned ReadForm always nil with err is io.EOF. As the test, we use the example with body almost similar to ExampleNewReader with header contains "Content-Disposition:form-data". Change-Id: I7268f45bb26eafb7f1e6e471b86eec681dde99f7
2023-05-11runtime: redefine _type to abi.Type; add rtype for methods.David Chase
Change-Id: I1c478b704d84811caa209006c657dda82d9c4cf9 Reviewed-on: https://go-review.googlesource.com/c/go/+/488435 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2023-05-11internal/bisect: copy parser changes from CL 494177Russ Cox
x/tools/cmd/bisect is changing to emit hex skips for robustness. Update this copy of internal/bisect to understand them. Change-Id: Ie9445714e8e9fb594e656db2f94dcde9b6ce82d1 Reviewed-on: https://go-review.googlesource.com/c/go/+/494178 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-11reflect: change rtype so that it (not *rtype) implements TypeDavid Chase
The abi.Type field was changed to *abi.Type, thus the bitwise representation is the same, many casts are now avoided and replace by either rtype{afoo} or rfoo.Type. Change-Id: Ie7643edc714a0e56027c2875498a4dfe989cf7dd Reviewed-on: https://go-review.googlesource.com/c/go/+/487558 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-11reflect: replacing almost all use of *rtype with *abi.TypeDavid Chase
Change-Id: I3601525b10237d828c449c62a3447f66cb6f025e Reviewed-on: https://go-review.googlesource.com/c/go/+/487557 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10reflect: move funcType to abi/type.goDavid Chase
Change-Id: I381229ba67a39487cdcc60da1c73d33b0a7d494a Reviewed-on: https://go-review.googlesource.com/c/go/+/487556 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com>
2023-05-10reflect: prepare fieldnames for moving to abi/type.goDavid Chase
Change-Id: Ia8e88029d29a1210dc7a321578e61336e235f35a Reviewed-on: https://go-review.googlesource.com/c/go/+/487555 Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2023-05-10internal/abi,reflectlite,reflect,runtime: common up chan typeDavid Chase
Change-Id: I085b61c544b85d70fabb1c0d9fe91207826dd21a Reviewed-on: https://go-review.googlesource.com/c/go/+/484858 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com>
2023-05-10reflect: move more types, constants, functions into internal/abiDavid Chase
Change-Id: Ib9cd15576896225e7c5e6fda11f1a77f6993a91a Reviewed-on: https://go-review.googlesource.com/c/go/+/484857 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2023-05-10internal/reflectlite, runtime: move more constants and types into internal/abiDavid Chase
Change-Id: If5da1057ead34eb3e4c7f42bbe6ad3d350b97725 Reviewed-on: https://go-review.googlesource.com/c/go/+/484856 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10internal/abi: common up ArrayTypeDavid Chase
This refactoring is more problematic because the client package wrap abi.Type, thus the self-referential fields within ArrayType need to be downcast to the client wrappers in several places. It's not clear to me this is worthwhile; this CL is for additional comment, before I attempt similar changes for other self-referential types. Change-Id: I41e517e6d851b32560c41676b91b76d7eb17c951 Reviewed-on: https://go-review.googlesource.com/c/go/+/466236 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2023-05-10internal/abi: common up some offset/size functionsDavid Chase
Change-Id: I92eeed20af35c7dec309457a80b8fd44eb70b57f Reviewed-on: https://go-review.googlesource.com/c/go/+/467876 Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com>
2023-05-10cmd/link: clean up per-binary slice creation in ldDavid Chase
A code cleanup opportunity noticed while trying to make slices be aligned. Change-Id: I34a807b4cf67d9b4a136c83714a34ffe71dcb166 Reviewed-on: https://go-review.googlesource.com/c/go/+/462757 Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10internal/abi: common up Method, Imethod, UncommonType typesDavid Chase
was two commits, the first contained a lot of intermediate work, better this way. Change-Id: I7c5b79ef78b21a85828c8aaf9baeae86bb144db7 Reviewed-on: https://go-review.googlesource.com/c/go/+/463118 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10internal/godebug: make test godebug calls not varyDavid Chase
I think there may be an issue in bisect search with change set elements not actually being independent, to be explored later. For now, modify the test to remove that property. Change-Id: I4b171bc024795d950cf4663374ad1dfc4e2952fc Reviewed-on: https://go-review.googlesource.com/c/go/+/494036 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2023-05-10html: convert fuzz test to native Go fuzzingTobias Klauser
Convert the existing gofuzz based fuzz test to a testing.F based fuzz test. Change-Id: Ieae69ba7fb17bd54d95c7bb2f4ed04c323c9f15f Reviewed-on: https://go-review.googlesource.com/c/go/+/494195 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
2023-05-10cmd/compile: add ability to print extra information in bisect outputRuss Cox
Change-Id: I619c21ab9754f67b69215cfed238a3e489c7fbcf Reviewed-on: https://go-review.googlesource.com/c/go/+/493955 Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2023-05-10net/http: let ErrNotSupported match errors.ErrUnsupportedIan Lance Taylor
For #41198 Change-Id: Ibb030e94618a1f594cfd98ddea214ad7a88d2e73 Reviewed-on: https://go-review.googlesource.com/c/go/+/494122 Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10go/types, types2: move xlist next to targs in Checker.arguments signatureRobert Griesemer
targs and xlist belong together (xlist contains the type expressions for each of the type arguments). Also, in builtins.go, rename xlist to alist2 to avoid some confusion. Preparation for adding more parameters to the Checker.arguments signature. Change-Id: I960501cfd2b88410ec0d581a6520a4e80fcdc56a Reviewed-on: https://go-review.googlesource.com/c/go/+/494121 Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
2023-05-10cmd/compile: add De Morgan's rewrite ruleStefan
Adds rules that rewrites statements such as ~P&~Q as ~(P|Q) and ~P|~Q as ~(P&Q), removing an extraneous instruction. Change-Id: Icedb97df741680ddf9799df79df78657173aa500 GitHub-Last-Rev: f22e2350c95e9052e990b2351c3c2b0af810e381 GitHub-Pull-Request: golang/go#60018 Reviewed-on: https://go-review.googlesource.com/c/go/+/493175 Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Stefan M <st3f4nm4d4@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-05-10go/types, types2: control type inference in Checker.funcInst via infer argumentRobert Griesemer
If the infer argument is true, funcInst behaves as before. If infer is false and there are not enough type arguments, rather then inferring the missing arguments and instantiating the function, funcInst returns the found type arguments. This permits the use of funcInst (and all the checks it does) to collect the type arguments for partially instantiated generic functions used as arguments to other functions. For #59338. Change-Id: I049034dfde52bd7ff4ae72964ff1708e154e5042 Reviewed-on: https://go-review.googlesource.com/c/go/+/494118 Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
2023-05-10cmd/go/internal: update documentation of go test and go generateShogo Hida
Fixes #57050 Change-Id: I46cac667ff78ac171c878f4366f8f01f58f1d27d GitHub-Last-Rev: 697c255ece18cd4772b76d62991474a7da2536d8 GitHub-Pull-Request: golang/go#57814 Reviewed-on: https://go-review.googlesource.com/c/go/+/461683 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2023-05-10cmd/go/internal/modload: skip reading go.mod files for imports in 'go mod ↵Bryan C. Mills
tidy' of modules before 'go 1.21' This eliminate a network access in 'go mod tidy' of an already-tidy module, which would otherwise be needed to fetch go.mod checksums for the test dependencies whose go.mod checksums were omitted in Go releases between Go 1.17 and 1.20 due to bug #56222. For modules between 'go 1.17' and 'go 1.20' we intentionally preserve the old 'go mod tidy' output (omitting go.sum entries for the go.mod files of test dependencies of external packages). We should also avoid performing extra sumdb lookups for checksums that would be discarded anyway. Updates #56222. Change-Id: I7f0f1c8e902db0e3414c819621c4b99052f503f0 Reviewed-on: https://go-review.googlesource.com/c/go/+/492741 Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10cmd/internal/obj/riscv: regenerate instruction encoding tableMeng Zhuo
This CL updates riscv instructions by https://github.com/riscv/riscv-opcodes which adds instruction: APAUSE And removes the following unused instructions: AFENCEI AFMVQX AFMVXQ AHFENCEGVMA AHFENCEVVMA ASLLIRV32 ASRAIRV32 ASRLIRV32 AURET Change-Id: I314570c643af3e6bbc9d2cd471b6b39985bcbdff Reviewed-on: https://go-review.googlesource.com/c/go/+/409415 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Joel Sing <joel@sing.id.au> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: M Zhuo <mzh@golangcn.org>
2023-05-10go/types, types2: explicitly look for nil type arguments in inferRobert Griesemer
Don't assume we have all type arguments if the number of type arguments matches the number of type parameters. Instead, look explicitly for nil type arguments in the provided targs. Preparation for type inference with type arguments provided for type parameters of generic function arguments passed to other functions. For #59338. Change-Id: I00918cd5ed06ae3277b4e41a3641063e0f53fef0 Reviewed-on: https://go-review.googlesource.com/c/go/+/494115 Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10encoding/csv: update doc comment of Read methodIvoGoman
This updates the doc comment to reflect the behavior of the method. On error the method returns a partial result. Fixes #59991 Change-Id: I71e9dfa37e0488c85abd3eeede2a1a34cb74239b GitHub-Last-Rev: 389488e5364dc939f0cbd11f99eb56001b5237a2 GitHub-Pull-Request: golang/go#60084 Reviewed-on: https://go-review.googlesource.com/c/go/+/494055 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
2023-05-10all: fix a lot of commentscui fliter
Fix comments, including duplicate is, wrong phrases and articles, misspellings, etc. Change-Id: I8bfea53b9b275e649757cc4bee6a8a026ed9c7a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/493035 Reviewed-by: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: shuang cui <imcusg@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-10log/slog: test built-in handlers with slogtestJonathan Amsterdam
Test the built-in handlers using the testing/slogtest package. Change-Id: I6464b6730293461c38b84fb2bf33cdd09173dd6e Reviewed-on: https://go-review.googlesource.com/c/go/+/488255 Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10log/slog: add json struct tags to SourceJonathan Amsterdam
Add tags to the fields of Source that lower-cases their names for JSON. The implementation still treats Source specially for performance, but now the result would be identical if it did not. Change-Id: I5fd2e500f1a301db62af87be8b877ecd954a26ec Reviewed-on: https://go-review.googlesource.com/c/go/+/494035 Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-10cmd: use slices.Equal to simplify codecui fliter
#57433 added slices.Equal, using it can reduce the amount of code Change-Id: I70d14b6c4c24da641a34ed36c900d9291033f526 Reviewed-on: https://go-review.googlesource.com/c/go/+/492576 Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: shuang cui <imcusg@gmail.com>
2023-05-10runtime: fix misaligned SP for libfuzzer entryKeith Randall
libfuzzer is written in C and so requires by the C abi that SP be aligned correctly mod 16. Normally CALLs need to have SP aligned to 0 mod 16, but because we're simulating a CALL (which pushes a return address) with a JMP (which doesn't), we need to align to 8 mod 16 before JMPing. This is not causing any current problems that I know of. All the functions called from this callsite that I checked don't rely on correct alignment. So this CL is just futureproofing. Update #49075 Change-Id: I13fcbe9aaf2853056a6d44dc3aa64b7db689e144 Reviewed-on: https://go-review.googlesource.com/c/go/+/494117 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
2023-05-09syscall,internal/poll: move pipe check from syscall.Seek to callersqmuntal
On Windows, syscall.Seek is a thin wrapper over SetFilePointerEx [1], which does not work on pipes, although it doesn't return an error on that case. To avoid this undefined behavior, Seek defensively calls GetFileType and errors if the type is FILE_TYPE_PIPE. The problem with this approach is that Seek is a low level foundational function that can be called many times for the same file, and the additional cgo call (GetFileType) will artificially slow down seek operations. I've seen GetFileType to account for 10% of cpu time in seek-intensive workloads. A better approach, implemented in this CL, would be to move the check one level up, where many times the file type is already known so the GetFileType is unnecessary. The drawback is that syscall.Seek has had this behavior since pipes where first introduced to Windows in https://codereview.appspot.com/1715046 and someone could be relying on it. On the other hand, this behavior is not documented, so we couldn't be breaking any contract. [1] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfilepointerex Change-Id: I7602182f9d08632e22a8a1635bc8ad9ad35a5056 Reviewed-on: https://go-review.googlesource.com/c/go/+/493626 Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-05-09internal/bisect: adjust stack PCs relative to Callers[2]David Chase
This is necessary to make hashes be consistent across runs, otherwise ASLR messes up search. Change-Id: Icf668dfe4c2008709f7767397b6700d0d5439287 Reviewed-on: https://go-review.googlesource.com/c/go/+/493857 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com>
2023-05-09cmd/go: fix cgo prefix mapping for non-vendored modulesqmuntal
Regression introduced in CL 478455. Change-Id: I8083a0accb047188dde1a3d408df2aafaf4a5356 Reviewed-on: https://go-review.googlesource.com/c/go/+/493835 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
2023-05-09runtime: exclude extra M's from debug.SetMaxThreadsMichael Pratt
The purpose of the debug.SetMaxThreads limit is to avoid accidental fork bomb from something like millions of goroutines blocking on system calls, causing the runtime to create millions of threads. By definition we don't create threads created in C, so this isn't a problem for those threads, and we can exclude them from the limit. If C wants to create tens of thousands of threads, who are we to say no? Fixes #60004. Change-Id: I62b875890718b406abca42a9a4078391e25aa21b Reviewed-on: https://go-review.googlesource.com/c/go/+/492743 Auto-Submit: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Pratt <mpratt@google.com>
2023-05-09misc/wasm: add wasmer to wasip1 scriptJohan Brandhorst-Satzkorn
The wasmer runtime will be used to test our wasip1 implementation against the WASI runtime from wasmer.io. For #59907 Change-Id: Ie7e48c39e03075815ddca46d996b6ec87009b12a Reviewed-on: https://go-review.googlesource.com/c/go/+/493775 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2023-05-09cmd/compile: remove FS debug hash formRuss Cox
The FS form was only necessary for reliable hashes in tests, and for that we can use -trimpath. Another potential concern would be temporary work directory names leaking into the names of files generated by cgo and the like, but we already make sure to avoid those to ensure reproducible builds: the compiler never sees those paths. So the FS form is not necessary for that either. Change-Id: Idae2c6acb22ab64dfb33bb053244d23fbe153830 Reviewed-on: https://go-review.googlesource.com/c/go/+/493737 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-05-09cmd/compile: use more of internal/bisect in HashDebugRuss Cox
Using more of internal/bisect gives us more that will be deleted from base/hashdebug.go when we have updated the tools that need the old protocol. It is also cheaper: there is no allocation to make a decision about whether to enable, and no locking unless printing is needed. Change-Id: I43ec398461205a1a9e988512a134ed6b3a3b1587 Reviewed-on: https://go-review.googlesource.com/c/go/+/493736 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-05-09cmd/compile: standardize on outer-to-inner for pos listsRuss Cox
The call sites that cared all reversed inner-to-outer to outer-to-inner already. The ones that didn't care left it alone. No one explicitly wanted inner-to-outer. Also change to a callback-based interface, so that call sites aren't required to accumulate the results in a slice (the main reason for that before was to reverse the slice!). There were three places where these lists were printed: 1. -d=ssa/genssa/dump, explicitly reversing to outer-to-inner 2. node dumps like -W, leaving the default inner-to-outer 3. file positions for HashDebugs, explicitly reversing to outer-to-inner It makes no sense that (1) and (2) would differ. The reason they do is that the code for (2) was too lazy to bother to fix it to be the right way. Consider this program: package p func f() { g() } func g() { println() } Both before and after this change, the ssa dump for f looks like: # x.go:3 00000 (3) TEXT <unlinkable>.f(SB), ABIInternal 00001 (3) FUNCDATA $0, gclocals·g2BeySu+wFnoycgXfElmcg==(SB) 00002 (3) FUNCDATA $1, gclocals·g2BeySu+wFnoycgXfElmcg==(SB) v4 00003 (-4) XCHGL AX, AX # x.go:4 # x.go:8 v5 00004 (+8) PCDATA $1, $0 v5 00005 (+8) CALL runtime.printlock(SB) v7 00006 (-8) CALL runtime.printnl(SB) v9 00007 (-8) CALL runtime.printunlock(SB) # x.go:5 b2 00008 (5) RET 00009 (?) END Note # x.go:4 (f) then # x.go:8 (g, called from f) between v4 and v5. The -W node dumps used the opposite order: before walk f . AS2 Def tc(1) # x.go:4:3 . INLMARK # +x.go:4:3 . PRINTN tc(1) # x.go:8:9,x.go:4:3 . LABEL p..i0 # x.go:4:3 Now they match the ssa dump order, and they use spaces as separators, to avoid potential problems with commas in some editors. before walk f . AS2 Def tc(1) # x.go:4:3 . INLMARK # +x.go:4:3 . PRINTN tc(1) # x.go:4:3 x.go:8:9 . LABEL p..i0 # x.go:4:3 I'm unaware of any argument for the old order other than it was easier to compute without allocation. The new code uses recursion to reverse the order without allocation. Now that the callers get the results outer-to-inner, most don't need any slices at all. This change is particularly important for HashDebug, which had been using a locked temporary slice to walk the inline stack without allocation. Now the temporary slice is gone. Change-Id: I5cb6d76b2f950db67b248acc928e47a0460569f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/493735 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Russ Cox <rsc@golang.org>
2023-05-09internal/godebug: add bisect supportRuss Cox
CL 491875 introduces a new bisect command, which we plan to document for use by end users to debug semantic changes in the compiler and in GODEBUGs. This CL adds bisect support to GODEBUGs, at least the ones used via internal/godebug. Support for runtime-internal GODEBUGs like panicnil will take a bit more work in followup CLs. The new API in internal/bisect to support stack-based bisecting should be easily reusable in non-GODEBUG settings as well, once we finalize and export the API. Change-Id: I6cf779c775329aceb3f3b2b2b2f221ce8a67deee Reviewed-on: https://go-review.googlesource.com/c/go/+/491975 Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2023-05-09runtime: calculate nanoseconds in usleep on linux/loong64Guoqi Chen
Change-Id: Ia4cfdea3df8834e6260527ce8e6e894a0547070f Reviewed-on: https://go-review.googlesource.com/c/go/+/425299 Reviewed-by: xiaodong liu <teaofmoli@gmail.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: WANG Xuerui <git@xen0n.name> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Meidan Li <limeidan@loongson.cn>
2023-05-09net: correct Dialer.ControlContext documentationJabar Asadi
Change-Id: I4ec5883fc8713e0f711bb6beff45f426dae8f9f4 GitHub-Last-Rev: 9ea0c1505c2f3974e5d224299db5f888a4cf7618 GitHub-Pull-Request: golang/go#59819 Reviewed-on: https://go-review.googlesource.com/c/go/+/488315 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2023-05-09cmd/link/internal/ppc64: fix export of R_DWARFSECREF to ELF on ppc64Paul E. Murphy
Today, external linking is not supported on any ppc64 ELF target, but soon openbsd will be enabled with external linking support. This relocation does not require additional endian specific fixups like most other PPC64 Go relocation types. I discovered this during an experiment to support external linking on ppc64/linux. Change-Id: I0b12b6172c7ba08df1c8cf024b4aa5e7ee76d0c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/492618 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-05-09net/http: regenerate h2_bundle.goBryan C. Mills
The x/net version was updated in CL 493596; cmd/internal/moddeps catches the skew, but only runs on the -longtest builders (because it requires network access for the bundle tool and x/net dependency). Change-Id: I48891d51aab23b2ca6f4484215438c60bd8c8c21 Reviewed-on: https://go-review.googlesource.com/c/go/+/493875 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
2023-05-09cmd/compile/loopvar: adjust logging messagesDavid Chase
Michael Stapelberg thought the former messages had upside potential, Russ and I agreed. Also slightly tweaked the json logging, not sure if anyone will use it but it should at least be okay. Change-Id: Iaab75114dd5f5d8f011fab22d32b57abc0272815 Reviewed-on: https://go-review.googlesource.com/c/go/+/493135 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com> Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Michael Stapelberg <stapelberg@google.com>
2023-05-09cmd: vendor golang.org/x/tools/cmd/bisectRuss Cox
Vendoring for use with the internal/godebug test and eventually the cmd/compile test as well. Change-Id: I3f7151949cff584705cb32ba39bf5de5cd45c3f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/493597 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-09cmd: go get golang.org/x/tools@8f7fb01dd429 and revendorRuss Cox
go get golang.org/x/tools@8f7fb01dd429 # CL 493619 go mod tidy go mod vendor The goal is to set up for importing the bisect command, for use in tests, in a follow-up CL. This also updates x/sys and x/net, including in std, because x/tools now depends on newer versions of those. Change-Id: I24c283cc165464d9c873ba7a9a4e75a9d02919b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/493596 Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
2023-05-08go/types, types2: infer minimum default type for untyped argumentsRobert Griesemer
This implements the proposal #58671. Must be explicitly enabled and requires proposal approval. For #58671. Change-Id: I150e78f4f3282d6b7cf9d90feeb5f1c5a36d8c38 Reviewed-on: https://go-review.googlesource.com/c/go/+/492835 Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@google.com>
2023-05-08go/types, types2: move functions for untyped constants into const.goRobert Griesemer
No changes to the moved functions. Generate const.go for go/types. Change-Id: I5ac412cecd9f618676a01138aed36428bbce3311 Reviewed-on: https://go-review.googlesource.com/c/go/+/493715 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-05-08cmd/compile/internal/types2: pass pos argument to Checker.overflowRobert Griesemer
This matches the go/types version of Checker.overflow. Preparation for generating this function (and others) for go/types. Change-Id: I84117203247011bd2e96c9cf53fd5a443e528bbf Reviewed-on: https://go-review.googlesource.com/c/go/+/493558 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Robert Griesemer <gri@google.com>