Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: fuzz/FilterFuzz.cpp

Issue 2478593003: Avoid params being initialized out of order in Fuzzer (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fuzz/Fuzz.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzz/FilterFuzz.cpp
diff --git a/fuzz/FilterFuzz.cpp b/fuzz/FilterFuzz.cpp
index 81e9bf1f15689756fb65624146bdfada6c6c38b0..c4756a141a4bc5e8a8c89c67b70d80c72dc09ec3 100644
--- a/fuzz/FilterFuzz.cpp
+++ b/fuzz/FilterFuzz.cpp
@@ -57,7 +57,8 @@ static bool return_large = false;
static bool return_undef = false;
static int R(int x) {
- return abs(fuzz->next<int>()) % x;
+ int i; fuzz->nextRange(&i, 0, x-1);
+ return i;
}
#if defined _WIN32
@@ -131,7 +132,8 @@ static SkString make_font_name() {
}
static bool make_bool() {
- return fuzz->next<bool>();
+ bool b; fuzz->next(&b);
+ return b;
}
static SkRect make_rect() {
« no previous file with comments | « no previous file | fuzz/Fuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698