Skip to content

Commit

Permalink
runtime: cleanup crashstack code
Browse files Browse the repository at this point in the history
This patch removes redundant guards for the crash stack feature, as all
supported Go architectures now have a crash stack implementation.
  • Loading branch information
mauri870 committed May 6, 2024
1 parent ff0bc46 commit 6ff56d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
31 changes: 0 additions & 31 deletions src/runtime/asm.s
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,3 @@ TEXT ·sigpanic0(SB),NOSPLIT,$0-0
TEXT ·mapinitnoop<ABIInternal>(SB),NOSPLIT,$0-0
RET

#ifndef GOARCH_386
#ifndef GOARCH_arm
#ifndef GOARCH_amd64
#ifndef GOARCH_arm64
#ifndef GOARCH_loong64
#ifndef GOARCH_mips
#ifndef GOARCH_mipsle
#ifndef GOARCH_mips64
#ifndef GOARCH_mips64le
#ifndef GOARCH_ppc64
#ifndef GOARCH_ppc64le
#ifndef GOARCH_riscv64
#ifndef GOARCH_s390x
#ifndef GOARCH_wasm
// stub to appease shared build mode.
TEXT ·switchToCrashStack0<ABIInternal>(SB),NOSPLIT,$0-0
UNDEF
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
2 changes: 1 addition & 1 deletion src/runtime/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func switchToCrashStack(fn func()) {
// Disable crash stack on Windows for now. Apparently, throwing an exception
// on a non-system-allocated crash stack causes EXCEPTION_STACK_OVERFLOW and
// hangs the process (see issue 63938).
const crashStackImplemented = (GOARCH == "386" || GOARCH == "amd64" || GOARCH == "arm" || GOARCH == "arm64" || GOARCH == "loong64" || GOARCH == "mips" || GOARCH == "mipsle" || GOARCH == "mips64" || GOARCH == "mips64le" || GOARCH == "ppc64" || GOARCH == "ppc64le" || GOARCH == "riscv64" || GOARCH == "s390x" || GOARCH == "wasm") && GOOS != "windows"
const crashStackImplemented = GOOS != "windows"

//go:noescape
func switchToCrashStack0(fn func()) // in assembly
Expand Down

0 comments on commit 6ff56d6

Please sign in to comment.