mirror of
https://github.com/golang/go.git
synced 2026-04-02 09:20:29 +09:00
CL 226737 optimized len check when make slice in common case when len is within range of cap. However, the generated code does not walk the AST for the if condition, causing un-walked nodes passed to the backend. Fixes #78028 Change-Id: I492fb230c10e585dc09391728ef4df2c0058ce12 Reviewed-on: https://go-review.googlesource.com/c/go/+/753100 Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jakub Ciolek <jakub@ciolek.dev> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com>
14 lines
256 B
Go
14 lines
256 B
Go
// compile
|
|
|
|
// Copyright 2026 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
var z = map[int]int{0: 1}
|
|
|
|
func main() {
|
|
_ = make([]byte, z[0], 1)
|
|
}
|