diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-07-15 16:43:33 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-07-17 08:31:25 +0000 |
| commit | abd11cfd08430ec5f9d2c6dbd0e0f798816922d1 (patch) | |
| tree | 522a8cc072d07d85c8a1d37b5b3ab89483599b48 /sys | |
| parent | a81f309b57265e5760b926274e1f1681e7550e41 (diff) | |
all: apply linter auto fixes
./tools/syz-env bin/golangci-lint run ./... --fix
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/openbsd/init.go | 7 | ||||
| -rw-r--r-- | sys/targets/targets.go | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/openbsd/init.go b/sys/openbsd/init.go index 5d0c3a77c..80cb6d4f0 100644 --- a/sys/openbsd/init.go +++ b/sys/openbsd/init.go @@ -170,20 +170,21 @@ func (arch *arch) neutralizeRlimit(c *prog.Call) { rlimitMin := uint64(0) rlimitMax := uint64(math.MaxUint64) resource := c.Args[0].(*prog.ConstArg).Val & rlimitMask - if resource == arch.RLIMIT_DATA { + switch resource { + case arch.RLIMIT_DATA: // OpenBSD performs a strict validation of the RLIMIT_DATA soft // limit during memory allocation. Lowering the same limit could // cause syz-executor to run out of memory quickly. Therefore // make sure to not go lower than the default soft limit for the // staff group. rlimitMin = 1536 * 1024 * 1024 - } else if resource == arch.RLIMIT_STACK { + case arch.RLIMIT_STACK: // Do not allow the stack to grow beyond the initial soft limit // chosen by syz-executor. Otherwise, syz-executor will most // likely not be able to perform any more heap allocations since // they majority of memory is reserved for the stack. rlimitMax = 1 * 1024 * 1024 - } else { + default: return } diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 1166134bc..67ae9bba4 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -675,7 +675,7 @@ func init() { // Fix cflags by replacing compiler's -m32 option with -m31 if arch == S390x { for i := range target.CFlags { - target.CFlags[i] = strings.Replace(target.CFlags[i], "-m32", "-m31", -1) + target.CFlags[i] = strings.ReplaceAll(target.CFlags[i], "-m32", "-m31") } } if runtime.GOOS == OpenBSD { @@ -924,7 +924,7 @@ func (target *Target) replaceSourceDir(param *string, sourceDir string) { target.BrokenCompiler = "SOURCEDIR is not set" return } - *param = strings.Replace(*param, sourceDirVar, sourceDir, -1) + *param = strings.ReplaceAll(*param, sourceDirVar, sourceDir) } func (target *Target) lazyInit() { |
