aboutsummaryrefslogtreecommitdiffstats
path: root/prog/mutation.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-14 10:32:29 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-15 16:02:37 +0200
commit91def5c506951f8a55f31979ce54657de460f528 (patch)
tree949774a5ae9e74524bb5a4e0b8a15bb7aa74332a /prog/mutation.go
parentc0cabacda7db153dcdb0940972a680296a9e56f3 (diff)
prog: remove special knowledge about "mmap" syscall
Abstract "mmap" away as it can be called differently on another OS.
Diffstat (limited to 'prog/mutation.go')
-rw-r--r--prog/mutation.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/prog/mutation.go b/prog/mutation.go
index e793e28e4..d92c96361 100644
--- a/prog/mutation.go
+++ b/prog/mutation.go
@@ -55,7 +55,7 @@ func (p *Prog) Mutate(rs rand.Source, ncalls int, ct *ChoiceTable, corpus []*Pro
continue
}
// Mutating mmap() arguments almost certainly doesn't give us new coverage.
- if c.Meta.Name == "mmap" && r.nOutOf(99, 100) {
+ if c.Meta == defaultTarget.MmapSyscall && r.nOutOf(99, 100) {
retry = true
continue
}
@@ -289,7 +289,7 @@ func Minimize(p0 *Prog, callIndex0 int, pred0 func(*Prog, int) bool, crash bool)
// Remove all mmaps.
for i := 0; i < len(p.Calls); i++ {
c := p.Calls[i]
- if i != callIndex && c.Meta.Name == "mmap" {
+ if i != callIndex && c.Meta == defaultTarget.MmapSyscall {
p.removeCall(i)
if i < callIndex {
callIndex--