• Ian Lance Taylor's avatar
    cmd/compile, syscall: add //go:uintptrescapes comment, and use it · bbe5da42
    Ian Lance Taylor authored
    This new comment can be used to declare that the uintptr arguments to a
    function may be converted from pointers, and that those pointers should
    be considered to escape. This is used for the Call methods in
    dll_windows.go that take uintptr arguments, because they call Syscall.
    
    We can't treat these functions as we do syscall.Syscall, because unlike
    Syscall they may cause the stack to grow. For Syscall we can assume that
    stack arguments can remain on the stack, but for these functions we need
    them to escape.
    
    Fixes #16035.
    
    Change-Id: Ia0e5b4068c04f8d303d95ab9ea394939f1f57454
    Reviewed-on: https://go-review.googlesource.com/24551Reviewed-by: 's avatarDavid Chase <drchase@google.com>
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    bbe5da42
dll_windows.go 8.85 KB