aboutsummaryrefslogtreecommitdiffstats
path: root/prog/mutation.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-10-29 23:42:36 +0200
committerDmitry Vyukov <dvyukov@google.com>2016-11-11 14:31:55 -0800
commitb40d502736438fcd899cda22e92fd0a159eecf4f (patch)
tree7c8998ec46220f2e42f34df34d28306c7661bc99 /prog/mutation.go
parent1838728cc121fd6c4c6f52d9c837f1e32e0c86f4 (diff)
prog: remote Type argument from Arg.Size/Value
They are not necessary since we now always have types attached to args. Also remove sys.Type.InnerType as it is not necessary now as well.
Diffstat (limited to 'prog/mutation.go')
-rw-r--r--prog/mutation.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/prog/mutation.go b/prog/mutation.go
index c014381d7..da8ad83bf 100644
--- a/prog/mutation.go
+++ b/prog/mutation.go
@@ -57,7 +57,7 @@ func (p *Prog) Mutate(rs rand.Source, ncalls int, ct *ChoiceTable) {
if base.Kind != ArgPointer || base.Res == nil {
panic("bad base arg")
}
- baseSize = base.Res.Size(base.Res.Type)
+ baseSize = base.Res.Size()
}
switch a := arg.Type.(type) {
case *sys.IntType, *sys.FlagsType, *sys.FileoffType, *sys.ResourceType, *sys.VmaType:
@@ -146,7 +146,7 @@ func (p *Prog) Mutate(rs rand.Source, ncalls int, ct *ChoiceTable) {
// TODO: we don't know size for out args
size := uintptr(1)
if arg.Res != nil {
- size = arg.Res.Size(arg.Res.Type)
+ size = arg.Res.Size()
}
arg1, calls1 := r.addr(s, a, size, arg.Res)
p.replaceArg(c, arg, arg1, calls1)
@@ -178,8 +178,8 @@ func (p *Prog) Mutate(rs rand.Source, ncalls int, ct *ChoiceTable) {
}
// Update base pointer if size has increased.
- if base != nil && baseSize < base.Res.Size(base.Res.Type) {
- arg1, calls1 := r.addr(s, base.Type, base.Res.Size(base.Res.Type), base.Res)
+ if base != nil && baseSize < base.Res.Size() {
+ arg1, calls1 := r.addr(s, base.Type, base.Res.Size(), base.Res)
for _, c1 := range calls1 {
sanitizeCall(c1)
}