Fixes #59174
Change-Id: I72b2b068830b90d42a0186addd004fb3175b9126
Reviewed-on: https://go-review.googlesource.com/c/go/+/478375
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Jakub Ciolek <jakub@ciolek.dev>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
}
func isInlinableMemclr(c *Config, sz int64) bool {
+ if sz < 0 {
+ return false
+ }
// TODO: expand this check to allow other architectures
// see CL 454255 and issue 56997
switch c.arch {
--- /dev/null
+// compile
+
+// Copyright 2023 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 p
+
+func p() {
+ s := make([]int, copy([]byte{' '}, "")-1)
+ _ = append([]int{}, make([]int, len(s))...)
+}