scc

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

commit a7170f9dbfe2396631013b806e6c184ad1f01aee
parent bba16a09cbc5fcecbaddb7c336035d44f9690869
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 20 Jan 2017 10:31:48 +0100

[cc1] Add comment in popctx()

The logic of why unlinking symbols is correct is not obvious
from the code, and similar comments were already added for
types and for symbols in cc2.

Diffstat:
Mcc1/symbol.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -107,6 +107,11 @@ popctx(void) Symbol *next, *sym; for (sym = head; sym && sym->ctx == curctx; sym = next) { + /* + * Since we are unlinking them in the inverse order + * we do know that tp is always the head of the + * collision list + */ next = sym->next; killsym(sym); }