Skip to content

Commit e39c7a3

Browse files
committed
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 <[email protected]> Run-TryBot: Quim Muntal <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Alex Brainman <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 030ca34 commit e39c7a3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/runtime/signal_windows_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ func TestVectoredHandlerDontCrashOnLibrary(t *testing.T) {
7979
if *flagQuick {
8080
t.Skip("-quick")
8181
}
82-
if runtime.GOARCH != "amd64" {
83-
t.Skip("this test can only run on windows/amd64")
82+
if runtime.GOARCH == "arm" {
83+
//TODO: remove this skip and update testwinlib/main.c
84+
// once windows/arm supports c-shared buildmode.
85+
// See go.dev/issues/43800.
86+
t.Skip("this test can't run on windows/arm")
8487
}
8588
testenv.MustHaveGoBuild(t)
8689
testenv.MustHaveCGO(t)

src/runtime/testdata/testwinlib/main.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ LONG WINAPI customExceptionHandlder(struct _EXCEPTION_POINTERS *ExceptionInfo)
1111
exceptionCount++;
1212
// prepare context to resume execution
1313
CONTEXT *c = ExceptionInfo->ContextRecord;
14-
c->Rip = *(ULONG_PTR *)c->Rsp;
14+
#ifdef _AMD64_
15+
c->Rip = *(DWORD64 *)c->Rsp;
1516
c->Rsp += 8;
17+
#elif defined(_X86_)
18+
c->Eip = *(DWORD *)c->Esp;
19+
c->Esp += 4;
20+
#else
21+
c->Pc = c->Lr;
22+
#endif
1623
return EXCEPTION_CONTINUE_EXECUTION;
1724
}
1825
return EXCEPTION_CONTINUE_SEARCH;

0 commit comments

Comments
 (0)