fuzz_with_unicorn: Randomize SP
This commit is contained in:
parent
9a7d75be3b
commit
a8b938ef32
1 changed files with 5 additions and 3 deletions
|
@ -182,10 +182,12 @@ static void RunTestInstance(const Unicorn::RegisterArray& regs, const Unicorn::V
|
||||||
static Dynarmic::A64::Jit jit{jit_user_config};
|
static Dynarmic::A64::Jit jit{jit_user_config};
|
||||||
static Unicorn uni{uni_env};
|
static Unicorn uni{uni_env};
|
||||||
|
|
||||||
|
const u64 initial_sp = RandInt<u64>(0x30'0000'0000, 0x40'0000'0000) * 4;
|
||||||
|
|
||||||
jit.SetRegisters(regs);
|
jit.SetRegisters(regs);
|
||||||
jit.SetVectors(vecs);
|
jit.SetVectors(vecs);
|
||||||
jit.SetPC(instructions_start);
|
jit.SetPC(instructions_start);
|
||||||
jit.SetSP(0x08000000);
|
jit.SetSP(initial_sp);
|
||||||
jit.SetFpcr(fpcr);
|
jit.SetFpcr(fpcr);
|
||||||
jit.SetFpsr(0);
|
jit.SetFpsr(0);
|
||||||
jit.SetPstate(pstate);
|
jit.SetPstate(pstate);
|
||||||
|
@ -193,7 +195,7 @@ static void RunTestInstance(const Unicorn::RegisterArray& regs, const Unicorn::V
|
||||||
uni.SetRegisters(regs);
|
uni.SetRegisters(regs);
|
||||||
uni.SetVectors(vecs);
|
uni.SetVectors(vecs);
|
||||||
uni.SetPC(instructions_start);
|
uni.SetPC(instructions_start);
|
||||||
uni.SetSP(0x08000000);
|
uni.SetSP(initial_sp);
|
||||||
uni.SetFpcr(fpcr);
|
uni.SetFpcr(fpcr);
|
||||||
uni.SetFpsr(0);
|
uni.SetFpsr(0);
|
||||||
uni.SetPstate(pstate);
|
uni.SetPstate(pstate);
|
||||||
|
@ -216,7 +218,7 @@ static void RunTestInstance(const Unicorn::RegisterArray& regs, const Unicorn::V
|
||||||
fmt::print("{:3s}: {:016x}\n", static_cast<A64::Reg>(i), regs[i]);
|
fmt::print("{:3s}: {:016x}\n", static_cast<A64::Reg>(i), regs[i]);
|
||||||
for (size_t i = 0; i < vecs.size(); ++i)
|
for (size_t i = 0; i < vecs.size(); ++i)
|
||||||
fmt::print("{:3s}: {}\n", static_cast<A64::Vec>(i), vecs[i]);
|
fmt::print("{:3s}: {}\n", static_cast<A64::Vec>(i), vecs[i]);
|
||||||
fmt::print("sp : 08000000\n");
|
fmt::print("sp : {:016x}\n", initial_sp);
|
||||||
fmt::print("pc : {:016x}\n", instructions_start);
|
fmt::print("pc : {:016x}\n", instructions_start);
|
||||||
fmt::print("p : {:08x}\n", pstate);
|
fmt::print("p : {:08x}\n", pstate);
|
||||||
fmt::print("fpcr {:08x}\n", fpcr);
|
fmt::print("fpcr {:08x}\n", fpcr);
|
||||||
|
|
Loading…
Reference in a new issue