Fix alignment of `CONTEXT` variable

The previous code had the `alignas()` in the wrong place, it needs to be
left of the typename.

Furthermore, `CONTEXT` has a default alignment of 16, so using `alignas(8)`
underaligns.

Signed-off-by: Chris Burel <burelc@amazon.com>
monroegm-disable-blank-issue-2
Chris Burel 4 years ago
parent 024cbdd2cd
commit 36487c1588

@ -1036,7 +1036,7 @@ cleanup:
} }
HANDLE hThread = nativeThread; HANDLE hThread = nativeThread;
CONTEXT alignas(8) context; // Without this alignment the function randomly crashes in release. alignas(alignof(CONTEXT)) CONTEXT context; // Without this alignment the function randomly crashes in release.
context.ContextFlags = CONTEXT_ALL; context.ContextFlags = CONTEXT_ALL;
GetThreadContext(hThread, &context); GetThreadContext(hThread, &context);

Loading…
Cancel
Save