From 575bdd6753e8c0c722158472ea9275cd463271ee Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 17 Feb 2015 20:45:23 -0800 Subject: [PATCH] [dev.cc] cmd/internal/obj/ppc64: set Ctxt when allocating Progs This will get fixed properly upstream, but this will serve for now. Change-Id: I25e5210d190bc7a06a5b9f80724e3360d1a6b10c Reviewed-on: https://go-review.googlesource.com/5121 Reviewed-by: Russ Cox --- src/cmd/internal/obj/ppc64/asm9.go | 2 ++ src/cmd/internal/obj/ppc64/obj9.go | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go index 5f6a4d7efd..1433710944 100644 --- a/src/cmd/internal/obj/ppc64/asm9.go +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -471,6 +471,7 @@ func span9(ctxt *obj.Link, cursym *obj.LSym) { otxt = p.Pcond.Pc - c if otxt < -(1<<15)+10 || otxt >= (1<<15)-10 { q = new(obj.Prog) + q.Ctxt = p.Ctxt q.Link = p.Link p.Link = q q.As = ABR @@ -478,6 +479,7 @@ func span9(ctxt *obj.Link, cursym *obj.LSym) { q.Pcond = p.Pcond p.Pcond = q q = new(obj.Prog) + q.Ctxt = p.Ctxt q.Link = p.Link p.Link = q q.As = ABR diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 2e0ec874fb..4675a9e7b0 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -515,7 +515,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { p.To.Reg = REGSP p.Spadj = -autosize - q = new(obj.Prog) + q = p.Ctxt.NewProg() q.As = ABR q.Lineno = p.Lineno q.To.Type = obj.TYPE_REG @@ -535,7 +535,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { p.To.Type = obj.TYPE_REG p.To.Reg = REGTMP - q = new(obj.Prog) + q = p.Ctxt.NewProg() q.As = AMOVD q.Lineno = p.Lineno q.From.Type = obj.TYPE_REG @@ -549,8 +549,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { if false { // Debug bad returns - q = new(obj.Prog) - + q = p.Ctxt.NewProg() q.As = AMOVD q.Lineno = p.Lineno q.From.Type = obj.TYPE_MEM @@ -565,7 +564,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { } if autosize != 0 { - q = new(obj.Prog) + q = p.Ctxt.NewProg() q.As = AADD q.Lineno = p.Lineno q.From.Type = obj.TYPE_CONST @@ -578,7 +577,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { p.Link = q } - q1 = new(obj.Prog) + q1 = p.Ctxt.NewProg() q1.As = ABR q1.Lineno = p.Lineno q1.To.Type = obj.TYPE_REG @@ -928,7 +927,7 @@ loop: } a = ABR - q = new(obj.Prog) + q = p.Ctxt.NewProg() q.As = int16(a) q.Lineno = p.Lineno q.To.Type = obj.TYPE_BRANCH -- 2.50.0