[PATCH 2/2] ntdll/tests: Raise an exception to check that EFlags.AC

Jefferson Carpenter jeffersoncarpenter2 at gmail.com
Thu Sep 3 12:39:49 CDT 2020


From bc7ed332d0baa86a4778101c115e07312283b3ea Mon Sep 17 00:00:00 2001
From: Jefferson Carpenter <jeffersoncarpenter2 at gmail.com>
Date: Thu, 3 Sep 2020 19:35:30 +0000
Subject: [PATCH 2/2] ntdll/tests: Raise an exception to check that EFlags.AC
 is cleared.

Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2 at gmail.com>
---
 dlls/ntdll/tests/exception.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c
index 494f8fd96e7..5104e40712c 100644
--- a/dlls/ntdll/tests/exception.c
+++ b/dlls/ntdll/tests/exception.c
@@ -773,6 +773,7 @@ static const BYTE align_check_code[] = {
     0x9d,                  	/* popf    */
     0x89,0xe1,                  /* mov %esp, %ecx */
     0x8b,0x49,0x1,              /* mov 0x1(%ecx), %ecx - cause exception */
+    0xfa,                  	/* cli - cause exception */
     0x35,0,0,4,0,       	/* xor    $0x40000,%eax */
     0x50,                  	/* push   %eax */
     0x9d,                  	/* popf    */
@@ -785,6 +786,7 @@ static DWORD align_check_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_
 {
     ok (!(context->EFlags & 0x40000), "eflags has AC bit set\n");
     got_exception++;
+    context->Eip++;  /* skip cli */
     return ExceptionContinueExecution;
 }
 
@@ -921,7 +923,7 @@ static void test_exceptions(void)
     /* test alignment exceptions */
     got_exception = 0;
     run_exception_test(align_check_handler, NULL, align_check_code, sizeof(align_check_code), 0);
-    ok(got_exception == 0, "got %d alignment faults, expected 0\n", got_exception);
+    ok(got_exception == 1, "got %d alignment faults, expected 0\n", got_exception);
 
     /* test direction flag */
     got_exception = 0;
-- 
2.26.2



More information about the wine-devel mailing list