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
1 changed files with 2 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue