From b40d502736438fcd899cda22e92fd0a159eecf4f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 29 Oct 2016 23:42:36 +0200 Subject: 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. --- prog/mutation.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'prog/mutation.go') 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) } -- cgit mrf-deployment