commit eeacd7b393061ba912ee5b07e8550a72cde1596a
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Mon Feb 20 15:39:30 2017 +0100
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Mon Feb 20 15:39:30 2017 +0100

    [cc1] Support out of order unlink in unlinkhash()
    
    The cpp symbols are defined/undefined in any order, so we need
    the support for out of order at least for them. Other symbols
    should have the invariant of being in the top of the collision
    list.

diff --git a/cc1/symbol.c b/cc1/symbol.c
index 3c5f9b1..7cb8d6f 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
@@ -88,7 +88,9 @@ unlinkhash(Symbol *sym)
        if ((sym->flags & SDECLARED) == 0)
                return;
        h = hash(sym->name, sym->ns);
-       assert(*h == sym);
+       assert(sym->ns == NS_CPP || *h == sym);
+       while (*h != sym)
+               h = &(*h)->hash;
        *h = sym->hash;
 }
 

Reply via email to