mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
cmd/compile: mark negative size memclr non-inlineable
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>
This commit is contained in:
parent
efaca3170f
commit
07559ceb72
@ -1370,6 +1370,9 @@ func zeroUpper56Bits(x *Value, depth int) bool {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
12
test/fixedbugs/issue59174.go
Normal file
12
test/fixedbugs/issue59174.go
Normal file
@ -0,0 +1,12 @@
|
||||
// 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))...)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user