mirror of
https://github.com/golang/go
synced 2024-11-23 13:50:06 -07:00
761443edd5
We generate an OpKeepAlive for the idata portion of the interface for a runtime.KeepAlive call. But given such an op, we need to keep the entire containing variable alive, not just the range that was passed to the OpKeepAlive operation. Fixes #17710 Change-Id: I90de66ec8065e22fb09bcf9722999ddda289ae6e Reviewed-on: https://go-review.googlesource.com/32477 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
14 lines
252 B
Go
14 lines
252 B
Go
// compile
|
|
|
|
// Copyright 2016 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
|
|
|
|
import "runtime"
|
|
|
|
func f(x interface{}) {
|
|
runtime.KeepAlive(x)
|
|
}
|