upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/allocator_proxy_test.cpp
diff options
context:
space:
mode:
authorRafael <rafaelalvesp2005@gmail.com>2026-11-23 15:36:26 -0300
committerRafael <rafaelalvesp2005@gmail.com>2026-11-23 15:36:26 -0300
commit63f0e0dea3a9d44201db408c4e2c3f2f5b2b94d6 (patch)
tree86f0dcad8070e2a3a693ef4897aa83950cfeb224 /runtime/test/allocator_proxy_test.cpp
parentf78f7d6a2a9364cb128c03ac539fe540d5c70df1 (diff)
parent6dda0630bd6fc0514baadb94fb98e36bd7d64c0b (diff)
Merge main into fix/walk-bink_names
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/allocator_proxy_test.cpp')
-rw-r--r--runtime/test/allocator_proxy_test.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/test/allocator_proxy_test.cpp b/runtime/test/allocator_proxy_test.cpp
index 733e37cac..5f89366f5 100644
--- a/runtime/test/allocator_proxy_test.cpp
+++ b/runtime/test/allocator_proxy_test.cpp
@@ -66,8 +66,12 @@ HRESULT call_slot(void* object, unsigned slot) {
66} 66}
67 67
68ULONG_PTR g_fault_address = 0; 68ULONG_PTR g_fault_address = 0;
69// The code is taken in the filter, from the exception record: GetExceptionCode() in the __except body returns 0
70// under Wine 9.0 (clang-cl reads it from what the unwind hands the handler, which that Wine does not supply).
71DWORD g_fault_code = 0;
69 72
70int record_fault(EXCEPTION_POINTERS* info) { 73int record_fault(EXCEPTION_POINTERS* info) {
74 g_fault_code = info->ExceptionRecord->ExceptionCode;
71 g_fault_address = info->ExceptionRecord->NumberParameters >= 2 ? info->ExceptionRecord->ExceptionInformation[1] : 0; 75 g_fault_address = info->ExceptionRecord->NumberParameters >= 2 ? info->ExceptionRecord->ExceptionInformation[1] : 0;
72 return EXCEPTION_EXECUTE_HANDLER; 76 return EXCEPTION_EXECUTE_HANDLER;
73} 77}
@@ -80,12 +84,13 @@ __declspec(noinline) void* read_entry(void* const* vtable, unsigned slot) {
80// Reads vtable[slot] the way a call through it does. The exception code, or 0 when the read worked. 84// Reads vtable[slot] the way a call through it does. The exception code, or 0 when the read worked.
81DWORD read_slot_guarded(void* const* vtable, unsigned slot) { 85DWORD read_slot_guarded(void* const* vtable, unsigned slot) {
82 g_fault_address = 0; 86 g_fault_address = 0;
87 g_fault_code = 0;
83 __try { 88 __try {
84 void* volatile entry = read_entry(vtable, slot); 89 void* volatile entry = read_entry(vtable, slot);
85 (void)entry; 90 (void)entry;
86 return 0; 91 return 0;
87 } __except (record_fault(GetExceptionInformation())) { 92 } __except (record_fault(GetExceptionInformation())) {
88 return GetExceptionCode(); 93 return g_fault_code;
89 } 94 }
90} 95}
91 96