Skip to content

Commit a6e512c

Browse files
committed
update tests
Change-Id: If229448904be3f8fe4a013cba2f74856b0e79f60
1 parent 3e4916f commit a6e512c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/escape_array.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func doesMakeSlice(x *string, y *string) { // ERROR "leaking param: x" "leaking
123123

124124
func nonconstArray() {
125125
n := 32
126-
s1 := make([]int, n) // ERROR "make\(\[\]int, n\) escapes to heap"
127-
s2 := make([]int, 0, n) // ERROR "make\(\[\]int, 0, n\) escapes to heap"
126+
s1 := make([]int, n) // ERROR "make\(\[\]int, 32\) does not escape"
127+
s2 := make([]int, 0, n) // ERROR "make\(\[\]int, 0, 32\) does not escape"
128128
_, _ = s1, s2
129129
}

test/escape_slice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func slice10() []*int {
9696
func slice11() {
9797
i := 2
9898
s := make([]int, 2, 3) // ERROR "make\(\[\]int, 2, 3\) does not escape"
99-
s = make([]int, i, 3) // ERROR "make\(\[\]int, i, 3\) does not escape"
99+
s = make([]int, i, 3) // ERROR "make\(\[\]int, 2, 3\) does not escape"
100100
s = make([]int, i, 1) // ERROR "make\(\[\]int, i, 1\) does not escape"
101101
_ = s
102102
}

test/fixedbugs/issue41635.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ func f() { // ERROR ""
1212
_ = make([]byte, 100, 1<<17) // ERROR "too large for stack" ""
1313
_ = make([]byte, n, 1<<17) // ERROR "too large for stack" ""
1414

15-
_ = make([]byte, n) // ERROR "non-constant size" ""
16-
_ = make([]byte, 100, m) // ERROR "non-constant size" ""
15+
_ = make([]byte, n) // ERROR "does not escape"
16+
_ = make([]byte, 100, m) // ERROR "does not escape"
1717
}

0 commit comments

Comments
 (0)