diff options
| author | Greg Steuck <greg@nest.cx> | 2023-04-24 20:27:30 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-04-25 17:36:18 +0200 |
| commit | 7560799c75f65327fe726b5b4b256d23b341709c (patch) | |
| tree | 17248a13063e63424fe909003ec4cf523529fcb0 /pkg/compiler | |
| parent | 9ceb3140bbe76018aa28dde0297f1139717373dc (diff) | |
sys/targets: introduce HasCallNumber to reduce clutter
This centralizes all strings.HasPrefix(callName, "syz_") checks.
Diffstat (limited to 'pkg/compiler')
| -rw-r--r-- | pkg/compiler/consts.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |
