diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-04-18 12:36:52 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-04-18 14:35:45 +0200 |
| commit | 67234372ef1e27c87a6be2e0141d70ae797231a1 (patch) | |
| tree | e6304ac41f5af586d81d84e31f9c8547754a32d9 /prog/rand.go | |
| parent | ea36da8271c508fe4c8bcc80af20ec81c812b95a (diff) | |
prog: refactor target.MakeMmap
Make MakeMmap return more than 1 call.
This is a preparation for future changes.
Also remove addr/size as they are effectively
always the same and can be inferred from the target
(will also conflict with the future changes).
Also rename to MakeDataMmap to better represent
the new purpose: it's just some arbitrary mmap,
but rather mapping of the data segment.
Diffstat (limited to 'prog/rand.go')
| -rw-r--r-- | prog/rand.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/prog/rand.go b/prog/rand.go index 8583fbdcb..c761d0b40 100644 --- a/prog/rand.go +++ b/prog/rand.go @@ -589,19 +589,12 @@ func (target *Target) GenerateAllSyzProg(rs rand.Source) *Prog { return p } -// GenerateSimpleProg generates the simplest non-empty program for testing -// (e.g. containing a single mmap). -func (target *Target) GenerateSimpleProg() *Prog { +// DataMmapProg creates program that maps data segment. +// Also used for testing as the simplest program. +func (target *Target) DataMmapProg() *Prog { return &Prog{ Target: target, - Calls: []*Call{target.MakeMmap(0, target.PageSize)}, - } -} - -func (target *Target) GenerateUberMmapProg() *Prog { - return &Prog{ - Target: target, - Calls: []*Call{target.MakeMmap(0, target.NumPages*target.PageSize)}, + Calls: target.MakeDataMmap(), } } |
