From 7560799c75f65327fe726b5b4b256d23b341709c Mon Sep 17 00:00:00 2001 From: Greg Steuck Date: Mon, 24 Apr 2023 20:27:30 +0100 Subject: sys/targets: introduce HasCallNumber to reduce clutter This centralizes all strings.HasPrefix(callName, "syz_") checks. --- pkg/compiler/consts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/compiler') diff --git a/pkg/compiler/consts.go b/pkg/compiler/consts.go index 3e8773a03..48a4f55aa 100644 --- a/pkg/compiler/consts.go +++ b/pkg/compiler/consts.go @@ -69,7 +69,7 @@ func (comp *compiler) extractConsts() map[string]*ConstInfo { info.defines[name] = v comp.addConst(infos, pos, name) case *ast.Call: - if comp.target.SyscallNumbers && !strings.HasPrefix(n.CallName, "syz_") { + if comp.target.HasCallNumber(n.CallName) { comp.addConst(infos, pos, comp.target.SyscallPrefix+n.CallName) } for _, attr := range n.Attrs { -- cgit mrf-deployment