Skip to content

Commit 358bf85

Browse files
committed
work
1 parent ee7fe17 commit 358bf85

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/tools/fuzzing/fuzzing.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,9 +1734,6 @@ void TranslateToFuzzReader::mutate(Function* func) {
17341734
// reasonable chance of making some changes.
17351735
percentChance = std::max(percentChance, Index(3));
17361736

1737-
// Half the time, use the SubtypingDiscoverer below.
1738-
bool useSubtypingDiscoverer = r & 1;
1739-
17401737
// First, find things to replace and their types. SubtypingDiscoverer needs to
17411738
// do this in a single, full walk (as types of children depend on parents, and
17421739
// even block targets).
@@ -1774,7 +1771,7 @@ void TranslateToFuzzReader::mutate(Function* func) {
17741771
void noteCast(Expression* src, Expression* dst) {}
17751772
} finder;
17761773

1777-
if (useSubtypingDiscoverer) {
1774+
if (oneIn(2)) {
17781775
// We read the IR here, and it must be totally valid - e.g. breaks have a
17791776
// proper break target - or else we'd hit internal errors. Fix it up first.
17801777
// (Otherwise, fixing it up is done once after mutation, and in that case
@@ -1820,6 +1817,8 @@ void TranslateToFuzzReader::mutate(Function* func) {
18201817
// We can only be given a less-refined type (certainly we can replace
18211818
// curr with its own type).
18221819
assert(Type::isSubType(curr->type, type));
1820+
// We only store an interesting non-trivial type.
1821+
assert(type != curr->type);
18231822
}
18241823
}
18251824

0 commit comments

Comments
 (0)