]> Cypherpunks repositories - gostls13.git/commit
runtime: crash the GC when clobberdead pointer is seen
authorCherry Zhang <cherryyz@google.com>
Thu, 15 Apr 2021 03:38:10 +0000 (23:38 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 20 Apr 2021 01:47:04 +0000 (01:47 +0000)
commit0ccdcb21024271211a64a5bb7e9c3c64d72f2699
tree086db4e584067fd54bdb4a673d5b4995e8e335f7
parent4f5aec46039347c7abc02a10103f35f936f39c2b
runtime: crash the GC when clobberdead pointer is seen

When -clobberdead compiler flag is set, the compiler inserts
instructions that set dead slots a specific value. If the GC sees
this value as a live pointer, something is probably wrong. Crash.

Only do this on AMD64 for now, as it is the only platform where
compiler's clobberdead mode is implemented. And on AMD64 the
clobberdead address can never be a valid address.

Change-Id: Ica687b132b5d3ba2a062500d13264fa730405d11
Reviewed-on: https://go-review.googlesource.com/c/go/+/310330
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/mbitmap.go