From 865ba27672fe7dddf43ae26c609e2471cfbaf3ed Mon Sep 17 00:00:00 2001 From: Eric Astor Date: Wed, 23 Sep 2020 11:45:42 -0400 Subject: [PATCH] Remove unnecessary macro from CaptureContext code The Windows implementation of CaptureContext used a macro to refer to the offset of a field in a struct. Bug: chromium:762167 Change-Id: I621d5c88283b1d066158559aade8811a9825c72e Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2426743 Reviewed-by: Mark Mentovai --- util/misc/capture_context_win.asm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/util/misc/capture_context_win.asm b/util/misc/capture_context_win.asm index b0093ba1..adb76e51 100644 --- a/util/misc/capture_context_win.asm +++ b/util/misc/capture_context_win.asm @@ -25,10 +25,6 @@ ifdef _M_IX86 .model flat endif -offsetof macro structure, field - exitm -endm - ; The CONTEXT structure definitions that follow are based on those in . ; Field names are prefixed (as in c_Rax) to avoid colliding with the predefined ; register names (such as Rax). @@ -481,8 +477,7 @@ CAPTURECONTEXT_SYMBOL proc frame cld lea rdi, [rcx.CONTEXT].c_FltSave xor rax, rax - mov rcx, (sizeof(CONTEXT) - offsetof(CONTEXT, c_FltSave)) / \ - sizeof(qword) ; 122 + mov rcx, (sizeof(CONTEXT) - CONTEXT.c_FltSave) / sizeof(qword) ; 122 rep stosq mov rcx, rbx