commit a0cfc89f2d6edb0f059c14000adab63913efce29
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Thu Sep 3 17:53:23 2015 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Thu Sep 3 17:53:23 2015 +0200

    Fix type in constant and var nodes
    
    The type of these nodes depende of the symbol passed as parameter,
    but the code was not updating the type, so it is needed copy the
    type from the symbol to the node.

diff --git a/cc1/code.c b/cc1/code.c
index ef836cd..50eb838 100644
--- a/cc1/code.c
+++ b/cc1/code.c
@@ -411,6 +411,7 @@ varnode(Symbol *sym)
        Node *np;
 
        np = node(OSYM, sym->type, NULL, NULL);
+       np->type = sym->type;
        np->lvalue = 1;
        np->constant = 0;
        np->symbol = 1;
@@ -424,6 +425,7 @@ constnode(Symbol *sym)
        Node *np;
 
        np = node(OSYM, sym->type, NULL, NULL);
+       np->type = sym->type;
        np->symbol = 1;
        np->constant = 1;
        np->sym = sym;

Reply via email to