From c490a45af6303c4aecff51ae140d5c825a711e18 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Wed, 4 Apr 2018 11:04:19 +0100 Subject: [PATCH] fuzz_with_unicorn: Correct GenRandomInst UnallocatedEncoding is now handled in ShouldTestInst --- tests/A64/fuzz_with_unicorn.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/A64/fuzz_with_unicorn.cpp b/tests/A64/fuzz_with_unicorn.cpp index 5c1416e3..ae7fcfde 100644 --- a/tests/A64/fuzz_with_unicorn.cpp +++ b/tests/A64/fuzz_with_unicorn.cpp @@ -61,7 +61,7 @@ static bool ShouldTestInst(u32 instruction, u64 pc, bool is_last_inst) { static u32 GenRandomInst(u64 pc, bool is_last_inst) { static const std::vector instruction_generators = []{ - const std::vector> list { + const std::vector> list { #define INST(fn, name, bitstring) {#fn, bitstring}, #include "frontend/A64/decoder/a64.inc" #undef INST @@ -71,8 +71,6 @@ static u32 GenRandomInst(u64 pc, bool is_last_inst) { // List of instructions not to test const std::vector do_not_test { - // Unallocated encodings are invalid. - "UnallocatedEncoding", // Unimplemented in QEMU "STLLR", // Unimplemented in QEMU @@ -82,6 +80,9 @@ static u32 GenRandomInst(u64 pc, bool is_last_inst) { }; for (const auto& [fn, bitstring] : list) { + if (fn == "UnallocatedEncoding") { + continue; + } if (std::find(do_not_test.begin(), do_not_test.end(), fn) != do_not_test.end()) { InstructionGenerator::AddInvalidInstruction(bitstring); continue;