Skip to content

Commit dbc5602

Browse files
committed
[dev.boringcrypto.go1.15] all: merge go1.15.2 into dev.boringcrypto.go1.15
Change-Id: Ibf4fe1ff683af56f4c4533cc43b67f73a68311e3
2 parents a15df60 + 9706f51 commit dbc5602

44 files changed

Lines changed: 775 additions & 229 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/go1.14.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,12 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
609609
If a program needs to accept invalid numbers like the empty string,
610610
consider wrapping the type with <a href="/pkg/encoding/json/#Unmarshaler"><code>Unmarshaler</code></a>.
611611
</p>
612+
613+
<p><!-- CL 200237 -->
614+
<a href="/pkg/encoding/json/#Unmarshal"><code>Unmarshal</code></a>
615+
can now support map keys with string underlying type which implement
616+
<a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>.
617+
</p>
612618
</dd>
613619
</dl><!-- encoding/json -->
614620

doc/go1.15.html

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ <h2 id="linker">Linker</h2>
357357
The linker now defaults to internal linking mode
358358
for <code>-buildmode=pie</code> on
359359
<code>linux/amd64</code> and <code>linux/arm64</code>, so these
360-
configurations no longer require a C linker.
360+
configurations no longer require a C linker. External linking
361+
mode (which was the default in Go 1.14 for
362+
<code>-buildmode=pie</code>) can still be requested with
363+
<code>-ldflags=-linkmode=external</code> flag.
361364
</p>
362365

363366
<h2 id="objdump">Objdump</h2>
@@ -433,6 +436,19 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
433436
</dd>
434437
</dl><!-- bufio -->
435438

439+
<dl id="context"><dt><a href="/pkg/context/">context</a></dt>
440+
<dd>
441+
<p><!-- CL 223777 -->
442+
Creating a derived <code>Context</code> using a nil parent is now explicitly
443+
disallowed. Any attempt to do so with the
444+
<a href="/pkg/context/#WithValue"><code>WithValue</code></a>,
445+
<a href="/pkg/context/#WithDeadline"><code>WithDeadline</code></a>, or
446+
<a href="/pkg/context/#WithCancel"><code>WithCancel</code></a> functions
447+
will cause a panic.
448+
</p>
449+
</dd>
450+
</dl><!-- context -->
451+
436452
<dl id="crypto"><dt><a href="/pkg/crypto/">crypto</a></dt>
437453
<dd>
438454
<p><!-- CL 231417, CL 225460 -->

src/cmd/compile/internal/gc/syntax.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ const (
141141
nodeInitorder, _ // tracks state during init1; two bits
142142
_, _ // second nodeInitorder bit
143143
_, nodeHasBreak
144-
_, nodeNoInline // used internally by inliner to indicate that a function call should not be inlined; set for OCALLFUNC and OCALLMETH only
145-
_, nodeImplicit
144+
_, nodeNoInline // used internally by inliner to indicate that a function call should not be inlined; set for OCALLFUNC and OCALLMETH only
145+
_, nodeImplicit // implicit OADDR or ODEREF; ++/-- statement represented as OASOP; or ANDNOT lowered to OAND
146146
_, nodeIsDDD // is the argument variadic
147147
_, nodeDiag // already printed error about this
148148
_, nodeColas // OAS resulting from :=

src/cmd/compile/internal/gc/walk.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ opswitch:
968968
case OANDNOT:
969969
n.Left = walkexpr(n.Left, init)
970970
n.Op = OAND
971+
n.SetImplicit(true) // for walkCheckPtrArithmetic
971972
n.Right = nod(OBITNOT, n.Right, nil)
972973
n.Right = typecheck(n.Right, ctxExpr)
973974
n.Right = walkexpr(n.Right, init)
@@ -3993,8 +3994,12 @@ func walkCheckPtrArithmetic(n *Node, init *Nodes) *Node {
39933994
case OADD:
39943995
walk(n.Left)
39953996
walk(n.Right)
3996-
case OSUB, OANDNOT:
3997+
case OSUB:
39973998
walk(n.Left)
3999+
case OAND:
4000+
if n.Implicit() { // was OANDNOT
4001+
walk(n.Left)
4002+
}
39984003
case OCONVNOP:
39994004
if n.Left.Type.Etype == TUNSAFEPTR {
40004005
n.Left = cheapexpr(n.Left, init)

src/cmd/compile/internal/ssa/gen/PPC64Ops.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,9 @@ func init() {
645645
{name: "LoweredAtomicOr8", argLength: 3, reg: gpstore, asm: "OR", faultOnNilArg0: true, hasSideEffects: true},
646646

647647
// LoweredWB invokes runtime.gcWriteBarrier. arg0=destptr, arg1=srcptr, arg2=mem, aux=runtime.gcWriteBarrier
648-
// It preserves R0 through R15, g, and its arguments R20 and R21,
648+
// It preserves R0 through R17 (except special registers R1, R2, R11, R12, R13), g, and its arguments R20 and R21,
649649
// but may clobber anything else, including R31 (REGTMP).
650-
{name: "LoweredWB", argLength: 3, reg: regInfo{inputs: []regMask{buildReg("R20"), buildReg("R21")}, clobbers: (callerSave &^ buildReg("R0 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R14 R15 R20 R21 g")) | buildReg("R31")}, clobberFlags: true, aux: "Sym", symEffect: "None"},
650+
{name: "LoweredWB", argLength: 3, reg: regInfo{inputs: []regMask{buildReg("R20"), buildReg("R21")}, clobbers: (callerSave &^ buildReg("R0 R3 R4 R5 R6 R7 R8 R9 R10 R14 R15 R16 R17 R20 R21 g")) | buildReg("R31")}, clobberFlags: true, aux: "Sym", symEffect: "None"},
651651

652652
// There are three of these functions so that they can have three different register inputs.
653653
// When we check 0 <= c <= cap (A), then 0 <= b <= c (B), then 0 <= a <= b (C), we want the

src/cmd/compile/internal/ssa/opGen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/compile/internal/ssa/phiopt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func phioptint(v *Value, b0 *Block, reverse int) {
154154
}
155155
v.AddArg(a)
156156

157-
cvt := v.Block.NewValue1(v.Pos, OpCvtBoolToUint8, a.Type, a)
157+
cvt := v.Block.NewValue1(v.Pos, OpCvtBoolToUint8, v.Block.Func.Config.Types.UInt8, a)
158158
switch v.Type.Size() {
159159
case 1:
160160
v.reset(OpCopy)

src/cmd/compile/internal/ssa/prove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,7 @@ func removeBranch(b *Block, branch branch) {
13341334
// isNonNegative reports whether v is known to be greater or equal to zero.
13351335
func isNonNegative(v *Value) bool {
13361336
if !v.Type.IsInteger() {
1337-
panic("isNonNegative bad type")
1337+
v.Fatalf("isNonNegative bad type: %v", v.Type)
13381338
}
13391339
// TODO: return true if !v.Type.IsSigned()
13401340
// SSA isn't type-safe enough to do that now (issue 37753).

src/cmd/go/internal/test/test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,9 +1079,13 @@ func (c *runCache) builderRunTest(b *work.Builder, a *work.Action) error {
10791079
}
10801080

10811081
var stdout io.Writer = os.Stdout
1082+
var err error
10821083
if testJSON {
10831084
json := test2json.NewConverter(lockedStdout{}, a.Package.ImportPath, test2json.Timestamp)
1084-
defer json.Close()
1085+
defer func() {
1086+
json.Exited(err)
1087+
json.Close()
1088+
}()
10851089
stdout = json
10861090
}
10871091

@@ -1185,7 +1189,7 @@ func (c *runCache) builderRunTest(b *work.Builder, a *work.Action) error {
11851189
}
11861190

11871191
t0 := time.Now()
1188-
err := cmd.Start()
1192+
err = cmd.Start()
11891193

11901194
// This is a last-ditch deadline to detect and
11911195
// stop wedged test binaries, to keep the builders

src/cmd/go/internal/test/testflag.go

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,13 @@ func testFlags(args []string) (packageNames, passToTest []string) {
214214

215215
explicitArgs := make([]string, 0, len(args))
216216
inPkgList := false
217+
afterFlagWithoutValue := false
217218
for len(args) > 0 {
218219
f, remainingArgs, err := cmdflag.ParseOne(&CmdTest.Flag, args)
219220

221+
wasAfterFlagWithoutValue := afterFlagWithoutValue
222+
afterFlagWithoutValue = false // provisionally
223+
220224
if errors.Is(err, flag.ErrHelp) {
221225
exitWithUsage()
222226
}
@@ -233,10 +237,24 @@ func testFlags(args []string) (packageNames, passToTest []string) {
233237
if nf := (cmdflag.NonFlagError{}); errors.As(err, &nf) {
234238
if !inPkgList && packageNames != nil {
235239
// We already saw the package list previously, and this argument is not
236-
// a flag, so it — and everything after it — must be a literal argument
237-
// to the test binary.
238-
explicitArgs = append(explicitArgs, args...)
239-
break
240+
// a flag, so it — and everything after it — must be either a value for
241+
// a preceding flag or a literal argument to the test binary.
242+
if wasAfterFlagWithoutValue {
243+
// This argument could syntactically be a flag value, so
244+
// optimistically assume that it is and keep looking for go command
245+
// flags after it.
246+
//
247+
// (If we're wrong, we'll at least be consistent with historical
248+
// behavior; see https://golang.org/issue/40763.)
249+
explicitArgs = append(explicitArgs, nf.RawArg)
250+
args = remainingArgs
251+
continue
252+
} else {
253+
// This argument syntactically cannot be a flag value, so it must be a
254+
// positional argument, and so must everything after it.
255+
explicitArgs = append(explicitArgs, args...)
256+
break
257+
}
240258
}
241259

242260
inPkgList = true
@@ -272,6 +290,9 @@ func testFlags(args []string) (packageNames, passToTest []string) {
272290

273291
explicitArgs = append(explicitArgs, nd.RawArg)
274292
args = remainingArgs
293+
if !nd.HasValue {
294+
afterFlagWithoutValue = true
295+
}
275296
continue
276297
}
277298

0 commit comments

Comments
 (0)