| 1 | // Copyright 2023 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package unsafeptr defines an Analyzer that checks for invalid |
| 6 | // conversions of uintptr to unsafe.Pointer. |
| 7 | // |
| 8 | // # Analyzer unsafeptr |
| 9 | // |
| 10 | // unsafeptr: check for invalid conversions of uintptr to unsafe.Pointer |
| 11 | // |
| 12 | // The unsafeptr analyzer reports likely incorrect uses of unsafe.Pointer |
| 13 | // to convert integers to pointers. A conversion from uintptr to |
| 14 | // unsafe.Pointer is invalid if it implies that there is a uintptr-typed |
| 15 | // word in memory that holds a pointer value, because that word will be |
| 16 | // invisible to stack copying and to the garbage collector. |
| 17 | package unsafeptr |