From e39c7a37f0f1a992eb65202d05c3148524c5c0ef Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 23 Jan 2023 15:13:20 +0100 Subject: runtime: run TestVectoredHandlerDontCrashOnLibrary on 386 and arm64 This CL updates TestVectoredHandlerDontCrashOnLibrary so it can run on windows/386 and windows/arm64. It still can't run on windows/arm as it does not support c-shared buildmode (see #43800). Change-Id: Id1577687e165e77d27633c632634ecf86e6e9d6f Reviewed-on: https://go-review.googlesource.com/c/go/+/463117 Reviewed-by: Bryan Mills Run-TryBot: Quim Muntal TryBot-Result: Gopher Robot Reviewed-by: Alex Brainman Reviewed-by: Cherry Mui --- src/runtime/testdata/testwinlib/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/runtime/testdata') diff --git a/src/runtime/testdata/testwinlib/main.c b/src/runtime/testdata/testwinlib/main.c index c3fe3cb071..55ee6571d7 100644 --- a/src/runtime/testdata/testwinlib/main.c +++ b/src/runtime/testdata/testwinlib/main.c @@ -11,8 +11,15 @@ LONG WINAPI customExceptionHandlder(struct _EXCEPTION_POINTERS *ExceptionInfo) exceptionCount++; // prepare context to resume execution CONTEXT *c = ExceptionInfo->ContextRecord; - c->Rip = *(ULONG_PTR *)c->Rsp; +#ifdef _AMD64_ + c->Rip = *(DWORD64 *)c->Rsp; c->Rsp += 8; +#elif defined(_X86_) + c->Eip = *(DWORD *)c->Esp; + c->Esp += 4; +#else + c->Pc = c->Lr; +#endif return EXCEPTION_CONTINUE_EXECUTION; } return EXCEPTION_CONTINUE_SEARCH; -- cgit v1.3