[hackers] [scc/qbe] [cc2] Add support for NULL in label2node() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 17 Aug 2016 14:29:50 +0200 (CEST)

commit 7843ca2e4e10e7b485b6de0b406bd702ff4a28a4
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Aug 17 14:01:29 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Aug 17 14:29:25 2016 +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.

diff --git a/cc2/code.c b/cc2/code.c
index 9ea9c56..356bd77 100644
--- a/cc2/code.c
+++ b/cc2/code.c
_AT_@ -71,6 +71,8 @@ label2node(Symbol *sym)
 {
         Node *np;
 
+ if(!sym)
+ sym = newlabel();
         np = newnode(OLABEL);
         np->u.sym = sym;
 
Received on Wed Aug 17 2016 - 14:29:50 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 17 2016 - 14:36:46 CEST