]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/riscv64: correct ssa.BlockRetJmp
authorJoel Sing <joel@sing.id.au>
Sun, 1 Mar 2020 17:26:21 +0000 (04:26 +1100)
committerJoel Sing <joel@sing.id.au>
Tue, 3 Mar 2020 07:33:49 +0000 (07:33 +0000)
The obj.Prog needs to be an obj.ARET rather than an obj.AJMP, otherwise the
epilogue does not get correctly produced.

Change-Id: Ie1262f2028d3b51720eeb0364a627fbde8b14df9
Reviewed-on: https://go-review.googlesource.com/c/go/+/221683
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/riscv64/ssa.go

index 167c9a3411984a88d884a3da5494b836c411b028..91f31643360f5b8344e696445073568af8eefb6f 100644 (file)
@@ -464,7 +464,7 @@ func ssaGenBlock(s *gc.SSAGenState, b, next *ssa.Block) {
        case ssa.BlockRet:
                s.Prog(obj.ARET)
        case ssa.BlockRetJmp:
-               p := s.Prog(obj.AJMP)
+               p := s.Prog(obj.ARET)
                p.To.Type = obj.TYPE_MEM
                p.To.Name = obj.NAME_EXTERN
                p.To.Sym = b.Aux.(*obj.LSym)