commit a67690e7a6ec3eb6deadc153711b4384db6f2002
parent c5e7306640964bd19c1a83adc33d2ea7856fc910
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 23 Jun 2016 15:37:49 +0200
[cc2-qbe] Update children pointers in sethi()
We need to update the pointers in sethi() because in other case it is
really hard to modify the tree.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
@@ -60,10 +60,12 @@ sethi(Node *np)
np->address = 11;
break;
default:
- sethi(lp);
- sethi(rp);
+ lp = sethi(lp);
+ rp = sethi(rp);
break;
}
+ np->left = lp;
+ np->right = rp;
if (np->address > 10)
return np;