From 5405d2e2ed019de7452677eacfc7de9562a8ea12 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 20 Nov 2020 17:30:23 +0100 Subject: pkg/ifuzz: invert ifuzz and ifuzzimpl ifuzzimpl imports the public interface package ifuzz and prog package needs to import ifuzzimpl (implementation guts that nobody outside of ifuzz should care about). This is not right. Invert everything so that prog package only needs to import ifuzz and ifuzz imports ifuzzimpl. --- prog/rand.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'prog/rand.go') diff --git a/prog/rand.go b/prog/rand.go index bc23ed427..a78f7e343 100644 --- a/prog/rand.go +++ b/prog/rand.go @@ -13,9 +13,6 @@ import ( "strings" "github.com/google/syzkaller/pkg/ifuzz" - "github.com/google/syzkaller/pkg/ifuzz/ifuzzimpl" - _ "github.com/google/syzkaller/pkg/ifuzz/powerpc/generated" // pull in generated instruction descriptions - _ "github.com/google/syzkaller/pkg/ifuzz/x86/generated" // pull in generated instruction descriptions ) const ( @@ -428,7 +425,7 @@ func (r *randGen) generateText(kind TextKind) []byte { switch kind { case TextTarget: if cfg := createTargetIfuzzConfig(r.target); cfg != nil { - return ifuzzimpl.Generate(cfg, r.Rand) + return ifuzz.Generate(cfg, r.Rand) } fallthrough case TextArm64: @@ -440,7 +437,7 @@ func (r *randGen) generateText(kind TextKind) []byte { return text default: cfg := createIfuzzConfig(kind) - return ifuzzimpl.Generate(cfg, r.Rand) + return ifuzz.Generate(cfg, r.Rand) } } @@ -448,14 +445,14 @@ func (r *randGen) mutateText(kind TextKind, text []byte) []byte { switch kind { case TextTarget: if cfg := createTargetIfuzzConfig(r.target); cfg != nil { - return ifuzzimpl.Mutate(cfg, r.Rand, text) + return ifuzz.Mutate(cfg, r.Rand, text) } fallthrough case TextArm64: return mutateData(r, text, 40, 60) default: cfg := createIfuzzConfig(kind) - return ifuzzimpl.Mutate(cfg, r.Rand, text) + return ifuzz.Mutate(cfg, r.Rand, text) } } -- cgit mrf-deployment