[hackers] [scc] [cc1] Add comment in popctx() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 20 Jan 2017 10:33:10 +0100 (CET)

commit a7170f9dbfe2396631013b806e6c184ad1f01aee
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Jan 20 10:31:48 2017 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Jan 20 10:31:48 2017 +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.

diff --git a/cc1/symbol.c b/cc1/symbol.c
index 24565d7..eedbc5f 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
_AT_@ -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);
         }
Received on Fri Jan 20 2017 - 10:33:10 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 20 2017 - 10:36:15 CET