scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 7843ca2e4e10e7b485b6de0b406bd702ff4a28a4
parent 2c8a93ddea9805bb425f55cac31a98c1032fe1af
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 17 Aug 2016 14:01:29 +0200

[cc2] Add support for NULL in label2node()

It is going to be useful to have the allocation of the node
in the own label2node(), because this function is going to be
used with auxiliar labels which are generated at the same
time than the node.

Diffstat:
Mcc2/code.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc2/code.c b/cc2/code.c @@ -71,6 +71,8 @@ label2node(Symbol *sym) { Node *np; + if(!sym) + sym = newlabel(); np = newnode(OLABEL); np->u.sym = sym;