[hackers] [scc] [cc2] Update the value of sym->u.inst || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 22 Jun 2016 16:41:29 +0200 (CEST)

commit c12bae156bbb7ea12f7b9370d5a3e661a2a35645
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Jun 22 16:38:15 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Jun 22 16:41:15 2016 +0200

    [cc2] Update the value of sym->u.inst
    
    When we call to setlabel() it means that this label is
    pointing to this instruction, so we have to make the label
    points to the instruction too, and not only the instruction
    to the label.

diff --git a/cc2/code.c b/cc2/code.c
index 8d4bc69..8b433c9 100644
--- a/cc2/code.c
+++ b/cc2/code.c
_AT_@ -84,6 +84,7 @@ setlabel(Symbol *sym)
                 return;
         code(0, NULL, NULL, NULL);
         pc->label = sym;
+ sym->u.inst = pc;
 }
 
 void
Received on Wed Jun 22 2016 - 16:41:29 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 22 2016 - 16:48:17 CEST