From dbd627eb61743340cb565ce41308beb4383a77be Mon Sep 17 00:00:00 2001 From: Veronica Radu Date: Mon, 12 Aug 2019 17:41:25 +0200 Subject: prog: add implementation for resource centric --- prog/analysis.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'prog/analysis.go') 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), -- cgit mrf-deployment