diff options
| author | Veronica Radu <veronicaradu@google.com> | 2019-08-12 17:41:25 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-09-03 16:30:45 +0200 |
| commit | dbd627eb61743340cb565ce41308beb4383a77be (patch) | |
| tree | 065a277c6b4dd3bd2798b5cba36fe744c8027b42 /prog/analysis.go | |
| parent | 8d48456885907439825fa265e0c375da5fdf1ecd (diff) | |
prog: add implementation for resource centric
Diffstat (limited to 'prog/analysis.go')
| -rw-r--r-- | prog/analysis.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/prog/analysis.go b/prog/analysis.go index 383ba15d1..f8330ed1c 100644 --- a/prog/analysis.go +++ b/prog/analysis.go @@ -15,6 +15,7 @@ import ( type state struct { target *Target ct *ChoiceTable + corpus []*Prog files map[string]bool resources map[string][]*ResultArg strings map[string]bool @@ -23,8 +24,8 @@ type state struct { } // analyze analyzes the program p up to but not including call c. -func analyze(ct *ChoiceTable, p *Prog, c *Call) *state { - s := newState(p.Target, ct) +func analyze(ct *ChoiceTable, corpus []*Prog, p *Prog, c *Call) *state { + s := newState(p.Target, ct, corpus) resources := true for _, c1 := range p.Calls { if c1 == c { @@ -35,10 +36,11 @@ func analyze(ct *ChoiceTable, p *Prog, c *Call) *state { return s } -func newState(target *Target, ct *ChoiceTable) *state { +func newState(target *Target, ct *ChoiceTable, corpus []*Prog) *state { s := &state{ target: target, ct: ct, + corpus: corpus, files: make(map[string]bool), resources: make(map[string][]*ResultArg), strings: make(map[string]bool), |
