Skip to content

Commit 42a2672

Browse files
committed
Ignore go:linkname directives in the internal/fuzz package.
All they do is insert fuzzing implementation stubs into the runtime package, which our runtime doesn't use anyway. The stubs should be discarded by dead code elimination automatically, so there is no disadvantage compared to excluding the original source file.
1 parent f754ef8 commit 42a2672

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/linkname.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func parseGoLinknames(fset *token.FileSet, pkgPath string, file *ast.File) ([]Go
116116

117117
decl := obj.Decl.(*ast.FuncDecl)
118118
if decl.Body != nil {
119-
if pkgPath == "runtime" || pkgPath == "internal/bytealg" {
119+
if pkgPath == "runtime" || pkgPath == "internal/bytealg" || pkgPath == "internal/fuzz" {
120120
// These standard library packages are known to use unsupported
121121
// "insert"-style go:linkname directives, which we ignore here and handle
122122
// case-by-case in native overrides.

0 commit comments

Comments
 (0)