mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-31 08:55:31 +00:00
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:
parent
56c6c02724
commit
3ad8d24943
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user