From 3a9bd603eda279837de4a9218444fafce13a3f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Oudompheng?= Date: Wed, 13 Jun 2012 16:24:42 -0400 Subject: [PATCH] [release-branch.go1] cmd/[568]g: correct freeing of allocated Regs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ««« backport f1028a23b059 cmd/[568]g: correct freeing of allocated Regs. R=golang-dev, rsc CC=golang-dev, remy https://golang.org/cl/6281050 »»» --- src/cmd/5g/reg.c | 4 ++-- src/cmd/6g/reg.c | 4 ++-- src/cmd/8g/reg.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c index 93724d03265..3932669733c 100644 --- a/src/cmd/5g/reg.c +++ b/src/cmd/5g/reg.c @@ -695,8 +695,8 @@ brk: } } } - if(r1 != R) { - r1->link = freer; + if(lastr != R) { + lastr->link = freer; freer = firstr; } diff --git a/src/cmd/6g/reg.c b/src/cmd/6g/reg.c index bed9f8da68b..049c63f17d4 100644 --- a/src/cmd/6g/reg.c +++ b/src/cmd/6g/reg.c @@ -780,8 +780,8 @@ brk: p->to.branch = p->to.branch->link; } - if(r1 != R) { - r1->link = freer; + if(lastr != R) { + lastr->link = freer; freer = firstr; } diff --git a/src/cmd/8g/reg.c b/src/cmd/8g/reg.c index 29270c8203a..45ffdf96c0a 100644 --- a/src/cmd/8g/reg.c +++ b/src/cmd/8g/reg.c @@ -677,8 +677,8 @@ brk: p->to.branch = p->to.branch->link; } - if(r1 != R) { - r1->link = freer; + if(lastr != R) { + lastr->link = freer; freer = firstr; }