From: Cherry Zhang Date: Wed, 27 May 2020 15:37:00 +0000 (-0400) Subject: cmd/compile: always use StackMapDontCare as register map index when reg map is not... X-Git-Tag: go1.15beta1~99 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6bf2eea62a3425c57f3d908ec32047a9ae41c025;p=gostls13.git cmd/compile: always use StackMapDontCare as register map index when reg map is not used When go115ReduceLiveness is true (so we don't emit actual register maps), use StackMapDontCare consistently for the register map index, so RegMapValid is always false. This fixes a compiler crash when doing -live=2 debug print. Fixes #39251. Change-Id: Ice087af491fa69c413f8ee59f923b72d592c0643 Reviewed-on: https://go-review.googlesource.com/c/go/+/235418 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index a4c051bda6..e2de6286a0 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -1249,7 +1249,7 @@ func (lv *Liveness) compact(b *ssa.Block) { if go115ReduceLiveness { hasStackMap := lv.hasStackMap(v) isUnsafePoint := lv.allUnsafe || lv.unsafePoints.Get(int32(v.ID)) - idx := LivenessIndex{StackMapDontCare, 0, isUnsafePoint} + idx := LivenessIndex{StackMapDontCare, StackMapDontCare, isUnsafePoint} if hasStackMap { idx.stackMapIndex = lv.stackMapSet.add(lv.livevars[pos].vars) pos++