diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-09-19 16:46:40 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-10-04 09:27:33 +0000 |
| commit | 8144982a26c6b8e5f0f5401c2a2de99e4ced04cd (patch) | |
| tree | e17e1e9cfd27739da3f002744506d22e73ff2c0d /sys/syz-extract/openbsd.go | |
| parent | c4dc646bee41c7e983a13750652f1035ae27b737 (diff) | |
sys: refactor const extraction
1) Make FabricateSyscallConsts() operate on ConstFile.
2) Expose Pos inside ConstInfo.
Diffstat (limited to 'sys/syz-extract/openbsd.go')
| -rw-r--r-- | sys/syz-extract/openbsd.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/syz-extract/openbsd.go b/sys/syz-extract/openbsd.go index f103d1949..9d9a7026e 100644 --- a/sys/syz-extract/openbsd.go +++ b/sys/syz-extract/openbsd.go @@ -71,11 +71,11 @@ func (*openbsd) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]ui "SYS_tmpfd": true, } compatNames := make(map[string][]string) - for _, val := range info.Consts { - if _, ok := syscallsQuirks[val]; ok { - compat := "SYS___" + val[len("SYS_"):] - compatNames[val] = append(compatNames[val], compat) - info.Consts = append(info.Consts, compat) + for _, def := range info.Consts { + if _, ok := syscallsQuirks[def.Name]; ok { + compat := "SYS___" + def.Name[len("SYS_"):] + compatNames[def.Name] = append(compatNames[def.Name], compat) + info.Consts = append(info.Consts, &compiler.Const{Name: compat}) } } params := &extractParams{ |
