mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/tests/x86_emulator: fix undefined behaviour in shift
Fixes this `-fsanitize=undefined` error: ``` test_x86_emulator.c:1103:32: runtime error: left shift of 573785183 by 2 places cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior test_x86_emulator.c:1103:32 ``` Signed-off-by: Edwin Török <edwin.torok@citrix.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
34e9c21514
commit
c8ff52f876
1 file changed
+1
-1
@@ -1100,7 +1100,7 @@ int main(int argc, char **argv)
|
||||
regs.edi = (unsigned long)res;
|
||||
rc = x86_emulate(&ctxt, &emulops);
|
||||
if ( (rc != X86EMUL_OKAY) ||
|
||||
(*res != ((0x2233445F << 2) | 2)) ||
|
||||
(*res != ((0x2233445FU << 2) | 2)) ||
|
||||
((regs.eflags & (EFLAGS_MASK & ~X86_EFLAGS_OF))
|
||||
!= EFLAGS_ALWAYS_SET) ||
|
||||
(regs.eip != (unsigned long)&instr[3]) )
|
||||
|
||||