File tree 1 file changed +15
-2
lines changed
src/cmd/compile/internal/ssagen 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -7083,8 +7083,21 @@ func genssa(f *ssa.Func, pp *objw.Progs) {
7083
7083
// for an empty block this will be used for its control
7084
7084
// instruction. We won't use the actual liveness map on a
7085
7085
// control instruction. Just mark it something that is
7086
- // preemptible, unless this function is "all unsafe".
7087
- s .pp .NextLive = objw.LivenessIndex {StackMapIndex : - 1 , IsUnsafePoint : liveness .IsUnsafe (f )}
7086
+ // preemptible, unless this function is "all unsafe", or
7087
+ // the empty block is in a write barrier.
7088
+ unsafe := liveness .IsUnsafe (f )
7089
+ if b .Kind == ssa .BlockPlain {
7090
+ // Empty blocks that are part of write barriers need
7091
+ // to have their control instructions marked unsafe.
7092
+ c := b .Succs [0 ].Block ()
7093
+ for _ , v := range c .Values {
7094
+ if v .Op == ssa .OpWBend {
7095
+ unsafe = true
7096
+ break
7097
+ }
7098
+ }
7099
+ }
7100
+ s .pp .NextLive = objw.LivenessIndex {StackMapIndex : - 1 , IsUnsafePoint : unsafe }
7088
7101
7089
7102
if idx , ok := argLiveBlockMap [b .ID ]; ok && idx != argLiveIdx {
7090
7103
argLiveIdx = idx
You can’t perform that action at this time.
0 commit comments