Skip to content

Commit

Permalink
cmd/5g, cmd/6g, cmd/8g, cmd/9g: zero more in componentgen
Browse files Browse the repository at this point in the history
Fix a flipped nil check.
The flipped check prevented componentgen
from zeroing a non-cadable nl.
This fix reduces the number of non-SB LEAQs
in godoc from 35323 to 34920 (-1.1%).

Update #1914

Change-Id: I15ea303068835f606f883ddf4a2bb4cb2287e9ae
Reviewed-on: https://go-review.googlesource.com/2605
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
  • Loading branch information
josharian committed Feb 13, 2015
1 parent 77a2113 commit 8f734d4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cmd/5g/cgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ componentgen(Node *nr, Node *nl)

nodl = *nl;
if(!cadable(nl)) {
if(nr == N || !cadable(nr))
if(nr != N && !cadable(nr))
goto no;
igen(nl, &nodl, N);
freel = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/6g/cgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,7 @@ componentgen(Node *nr, Node *nl)

nodl = *nl;
if(!cadable(nl)) {
if(nr == N || !cadable(nr))
if(nr != N && !cadable(nr))
goto no;
igen(nl, &nodl, N);
freel = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/8g/cgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ componentgen(Node *nr, Node *nl)

nodl = *nl;
if(!cadable(nl)) {
if(nr == N || !cadable(nr))
if(nr != N && !cadable(nr))
goto no;
igen(nl, &nodl, N);
freel = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/9g/cgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ componentgen(Node *nr, Node *nl)

nodl = *nl;
if(!cadable(nl)) {
if(nr == N || !cadable(nr))
if(nr != N && !cadable(nr))
goto no;
igen(nl, &nodl, N);
freel = 1;
Expand Down

0 comments on commit 8f734d4

Please sign in to comment.