aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--prog/hints.go1
-rw-r--r--prog/minimization_test.go6
-rw-r--r--prog/validation.go6
3 files changed, 9 insertions, 4 deletions
diff --git a/prog/hints.go b/prog/hints.go
index 778655105..5250476e4 100644
--- a/prog/hints.go
+++ b/prog/hints.go
@@ -67,6 +67,7 @@ func (p *Prog) MutateWithHints(callIndex int, comps CompMap, exec func(p *Prog))
p = p.Clone()
c := p.Calls[callIndex]
execValidate := func() {
+ p.Target.SanitizeCall(c)
if debug {
if err := p.validate(); err != nil {
panic(fmt.Sprintf("invalid hints candidate: %v", err))
diff --git a/prog/minimization_test.go b/prog/minimization_test.go
index 9cedb940f..d41663e70 100644
--- a/prog/minimization_test.go
+++ b/prog/minimization_test.go
@@ -46,7 +46,7 @@ func TestMinimize(t *testing.T) {
// Aim at removal of sched_yield.
return len(p.Calls) == 2 && p.Calls[0].Meta.Name == "mmap" && p.Calls[1].Meta.Name == "pipe2"
},
- "mmap(&(0x7f0000000000/0x1000)=nil, 0x1000, 0x0, 0x0, 0xffffffffffffffff, 0x0)\n" +
+ "mmap(&(0x7f0000000000/0x1000)=nil, 0x1000, 0x0, 0x10, 0xffffffffffffffff, 0x0)\n" +
"pipe2(&(0x7f0000000000), 0x0)\n",
1,
},
@@ -79,7 +79,7 @@ func TestMinimize(t *testing.T) {
func(p *Prog, callIndex int) bool {
return p.String() == "mmap-write-sched_yield"
},
- "mmap(&(0x7f0000000000/0x1000)=nil, 0x1000, 0x0, 0x0, 0xffffffffffffffff, 0x0)\n" +
+ "mmap(&(0x7f0000000000/0x1000)=nil, 0x1000, 0x0, 0x10, 0xffffffffffffffff, 0x0)\n" +
"write(0xffffffffffffffff, &(0x7f0000000000), 0x0)\n" +
"sched_yield()\n",
2,
@@ -94,7 +94,7 @@ func TestMinimize(t *testing.T) {
func(p *Prog, callIndex int) bool {
return p.String() == "mmap-write-sched_yield"
},
- "mmap(&(0x7f0000000000/0x1000)=nil, 0x1000, 0x0, 0x0, 0xffffffffffffffff, 0x0)\n" +
+ "mmap(&(0x7f0000000000/0x1000)=nil, 0x1000, 0x0, 0x10, 0xffffffffffffffff, 0x0)\n" +
"write(0xffffffffffffffff, &(0x7f0000000000), 0x0)\n" +
"sched_yield()\n",
-1,
diff --git a/prog/validation.go b/prog/validation.go
index 148640650..133da3adb 100644
--- a/prog/validation.go
+++ b/prog/validation.go
@@ -48,7 +48,11 @@ func (ctx *validCtx) validateCall(c *Call) error {
return err
}
}
- return ctx.validateRet(c)
+ if err := ctx.validateRet(c); err != nil {
+ return err
+ }
+ ctx.target.SanitizeCall(c)
+ return nil
}
func (ctx *validCtx) validateRet(c *Call) error {