From f35d98c92303c4a1d8421dda560c7ab48133ffb4 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sun, 25 Apr 2021 22:58:21 +0100 Subject: [PATCH] fuzz_with_unicorn: Widen scope of floating point fuzzing --- tests/A64/fuzz_with_unicorn.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/A64/fuzz_with_unicorn.cpp b/tests/A64/fuzz_with_unicorn.cpp index a95cc7e0..e32f606a 100644 --- a/tests/A64/fuzz_with_unicorn.cpp +++ b/tests/A64/fuzz_with_unicorn.cpp @@ -139,7 +139,7 @@ static u32 GenFloatInst(u64 pc, bool is_last_inst) { const size_t index = RandInt(0, instruction_generators.size() - 1); const u32 instruction = instruction_generators[index].Generate(); - if ((instruction & 0x00800000) == 0 && ShouldTestInst(instruction, pc, is_last_inst)) { + if (ShouldTestInst(instruction, pc, is_last_inst)) { return instruction; } } @@ -410,6 +410,9 @@ TEST_CASE("A64: Floating point instructions", "[a64]") { }; const auto gen_float = [&]{ + if (RandInt(0, 1) == 0) { + return RandInt(0, 0xffffffff); + } return float_numbers[RandInt(0, float_numbers.size() - 1)]; };