[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 08/13] fuzz/x86_emulate: Take multiple test files for inputs
On 10/04/2017 09:24 AM, Jan Beulich wrote: >>>> On 25.09.17 at 16:26, <george.dunlap@xxxxxxxxxx> wrote: >> --- a/tools/fuzz/x86_instruction_emulator/afl-harness.c >> +++ b/tools/fuzz/x86_instruction_emulator/afl-harness.c >> @@ -16,6 +16,8 @@ int main(int argc, char **argv) >> { >> size_t size; >> FILE *fp = NULL; >> + int count = 0; >> + int max; > > Generally speaking these should be unsigned int, but I see how this > collides with the types of the variables max is being calculated from. > In any event both could go on a single line. Ack > >> @@ -66,11 +70,14 @@ int main(int argc, char **argv) >> __AFL_INIT(); >> >> while ( __AFL_LOOP(1000) ) >> +#else >> + for( count = 0; count < max; count++ ) > > Initially I've thought the initializer on count was pointless further > up because of the re-initialization here. Of course that's needed > because of the #if/#else this sits in. Hence I wonder whether omitting > the assignment here wouldn't be appropriate - it wouldn't really be > wromng for a compiler to warn about this redundancy. Could do that I suppose. The other option would be to change the other loop to `for ( count = 0; __AFL_LOOP(1000); )` Let me know if you have any preference. > Either way > Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Thanks, -George _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |