aboutsummaryrefslogtreecommitdiffstats
path: root/prog
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-11-20 17:30:23 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-11-21 08:46:20 +0100
commit5405d2e2ed019de7452677eacfc7de9562a8ea12 (patch)
tree7b2f9f488a4b57ce9a40e4d16bc263c2f00d8e48 /prog
parent9bc78a846441516a33a7fd3b245380f463ba88ed (diff)
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.
Diffstat (limited to 'prog')
-rw-r--r--prog/rand.go11
1 files changed, 4 insertions, 7 deletions
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)
}
}