}
// keepAliveAt returns a statement that is either curNode, or a
-// block containing curNode followed by a call to runtime.keepAlive for each
+// block containing curNode followed by a call to runtime.KeepAlive for each
// node in ns. These calls ensure that nodes in ns will be live until
// after curNode's execution.
func keepAliveAt(ns []ir.Node, curNode ir.Node) ir.Node {
if n.Sym().IsBlank() {
continue
}
- arg := ir.NewConvExpr(pos, ir.OCONV, types.Types[types.TINTER], n)
+ arg := ir.NewConvExpr(pos, ir.OCONV, types.Types[types.TUNSAFEPTR], typecheck.NodAddr(n))
if !n.Type().IsInterface() {
srcRType0 := reflectdata.TypePtrAt(pos, n.Type())
arg.TypeWord = srcRType0
}
somethingptr := &something
for b.Loop() { // ERROR "inlining call to testing\.\(\*B\)\.Loop"
- caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive" ".* does not escape"
- caninlineNoRet(1) // ERROR "inlining call to caninlineNoRet" "function arg will be kept alive" ".* does not escape"
+ caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive"
+ caninlineNoRet(1) // ERROR "inlining call to caninlineNoRet" "function arg will be kept alive"
caninlineVariadic(1) // ERROR "inlining call to caninlineVariadic" "function arg will be kept alive" ".* does not escape"
caninlineVariadic(localsink) // ERROR "inlining call to caninlineVariadic" "localsink will be kept alive" ".* does not escape"
- localsink = caninline(1) // ERROR "inlining call to caninline" "localsink will be kept alive" ".* does not escape"
- localsink += 5 // ERROR "localsink will be kept alive" ".* does not escape"
- localsink, cond = 1, 2 // ERROR "localsink will be kept alive" "cond will be kept alive" ".* does not escape"
+ localsink = caninline(1) // ERROR "inlining call to caninline" "localsink will be kept alive"
+ localsink += 5 // ERROR "localsink will be kept alive"
+ localsink, cond = 1, 2 // ERROR "localsink will be kept alive" "cond will be kept alive"
*somethingptr = 1 // ERROR "dereference will be kept alive"
if cond > 0 {
- caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive" ".* does not escape"
+ caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive"
}
switch cond {
case 2:
- caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive" ".* does not escape"
+ caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive"
}
{
- caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive" ".* does not escape"
+ caninline(1) // ERROR "inlining call to caninline" "function result will be kept alive"
}
}
}