hypervisor: x86: emulator: fix a variable

Comparing RAX with RIP makes no logical sense other than RIP happens to
be the correct value. Use `target_rax` instead.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2024-06-27 22:32:30 +00:00 committed by Bo Chen
parent 56c6c02724
commit 3ad8d24943

View File

@ -778,6 +778,7 @@ mod tests {
// mov rbx, qword ptr [rax+10h]
// Test with a first instruction truncated.
fn test_fetch_first_instruction() {
let target_rax: u64 = 0x1000;
let ip: u64 = 0x1000;
let cpu_id = 0;
let memory = [
@ -802,7 +803,7 @@ mod tests {
.unwrap()
.read_reg(Register::RAX)
.unwrap();
assert_eq!(rax, ip);
assert_eq!(rax, target_rax);
}
#[test]