scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit ab786f9263208bb36beda54cf44c0180e197a92b
parent ef1b413ce63057ad946e5dbb202006196e8d1510
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed,  3 Nov 2021 05:30:19 +0100

cc2/qbe: Avoid mixing code and declarations

Diffstat:
Msrc/cmd/cc/cc2/target/qbe/cgen.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cmd/cc/cc2/target/qbe/cgen.c b/src/cmd/cc/cc2/target/qbe/cgen.c @@ -455,7 +455,8 @@ swtch_if(Node *idx) static Node * rhs(Node *np, Node *ret) { - Node aux1, aux2, *phi, *l = np->left, *r = np->right; + Node aux1, aux2, aux3; + Node *phi, *l = np->left, *r = np->right; Type *tp; int off, op; char *tbl; @@ -574,7 +575,7 @@ rhs(Node *np, Node *ret) aux2.right = np->right; aux2.left = np->left; r = rhs(&aux2, &aux1); - Node aux3; + if (l->op == OCAST) { aux3.type = l->left->type; aux3.op = OCAST;