From 7b5a34418cd32ec4d2c0f7d6e4c7e6fe7585a17f Mon Sep 17 00:00:00 2001 From: qmuntal Date: Mon, 23 Jan 2023 12:59:29 +0100 Subject: runtime: remove unused badsignal2 on windows This CL removes badsignal2 function, as it is unused on Windows. badsignal2 was originally intended to abort the process when an exception was raised on a non-Go thread, following the same approach as Linux and others. Since it was added, back on https://golang.org/cl/5797068, it has caused several issues on Windows, see #8224 and #50877. That's because we can't know wether the signal is bad or not, as our trap might not be at the end of the exception handler chain. To fix those issues, https://golang.org/cl/104200046 and CL 442896 stopped calling badsignal2, and CL 458135 removed one last incorrect call on amd64 and 386. Change-Id: I5bd31ee2672118ae0f1a2c8b46a1bb0f4893a011 Reviewed-on: https://go-review.googlesource.com/c/go/+/463116 Reviewed-by: Bryan Mills Run-TryBot: Quim Muntal Reviewed-by: Alex Brainman Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot --- src/runtime/sys_windows_arm64.s | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/runtime/sys_windows_arm64.s') diff --git a/src/runtime/sys_windows_arm64.s b/src/runtime/sys_windows_arm64.s index 67fe21b2d0..ab6944c9ea 100644 --- a/src/runtime/sys_windows_arm64.s +++ b/src/runtime/sys_windows_arm64.s @@ -99,32 +99,6 @@ _0args: LDP.P 32(RSP), (R29, R30) RET -TEXT runtime·badsignal2(SB),NOSPLIT,$16-0 - NO_LOCAL_POINTERS - - // stderr - MOVD runtime·_GetStdHandle(SB), R1 - MOVD $-12, R0 - SUB $16, RSP // skip over saved frame pointer below RSP - BL (R1) - ADD $16, RSP - - // handle in R0 already - MOVD $runtime·badsignalmsg(SB), R1 // lpBuffer - MOVD $runtime·badsignallen(SB), R2 // lpNumberOfBytesToWrite - MOVD (R2), R2 - // point R3 to stack local that will receive number of bytes written - ADD $16, RSP, R3 // lpNumberOfBytesWritten - MOVD $0, R4 // lpOverlapped - MOVD runtime·_WriteFile(SB), R12 - SUB $16, RSP // skip over saved frame pointer below RSP - BL (R12) - - // Does not return. - B runtime·abort(SB) - - RET - TEXT runtime·getlasterror(SB),NOSPLIT|NOFRAME,$0 MOVD TEB_error(R18_PLATFORM), R0 MOVD R0, ret+0(FP) -- cgit v1.3