shithub: scc

Download patch

ref: 72996baa32cf2e7d7e26bbc3cca1ca4340a35f7d
parent: 6635e122751e5c87ee80dfd72e358e74848ca0f0
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Jan 20 05:31:48 EST 2017

[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.

--- a/cc1/symbol.c
+++ b/cc1/symbol.c
@@ -107,6 +107,11 @@
 	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);
 	}