From 85d1218f4108e0fe793f63e57e2edadd5da5764f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 18 Feb 2018 13:49:48 +0100 Subject: prog: rework foreachArg Make Foreach* callback accept the arg and a context struct that can contain lots of aux info. This (1) removes lots of unuser base/parent args, (2) provides foundation for stopping recursion, (3) allows to merge foreachSubargOffset. --- prog/hints_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prog/hints_test.go') diff --git a/prog/hints_test.go b/prog/hints_test.go index 80a9042dd..9a87d3014 100644 --- a/prog/hints_test.go +++ b/prog/hints_test.go @@ -364,8 +364,8 @@ func TestHintsRandom(t *testing.T) { func extractValues(c *Call) map[uint64]bool { vals := make(map[uint64]bool) - foreachArg(c, func(arg, _ Arg, _ *[]Arg) { - if arg.Type().Dir() == DirOut { + ForeachArg(c, func(arg Arg, _ *ArgCtx) { + if typ := arg.Type(); typ == nil || typ.Dir() == DirOut { return } switch a := arg.(type) { -- cgit mrf-deployment