scc

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

commit c12bae156bbb7ea12f7b9370d5a3e661a2a35645
parent 8945d761a051d5bc4fcfa9fe947a9fb74f9c9641
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 22 Jun 2016 16:38:15 +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.

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

diff --git a/cc2/code.c b/cc2/code.c @@ -84,6 +84,7 @@ setlabel(Symbol *sym) return; code(0, NULL, NULL, NULL); pc->label = sym; + sym->u.inst = pc; } void