summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-06-24 09:54:00 +0200
committerGitHub <noreply@github.com>2018-06-24 09:54:00 +0200
commit105a472dc5eb239c68d7e13d8eef93c8dc0311be (patch)
treedf268bcc941dfdadcbf17b447b386ccc51cb0b41 /compiler
parent4c2e712056b1e23d89be51f9cdcbfe573c399819 (diff)
parente39baf46fc523245a7d73b263808b944c6f225db (diff)
downloadNim-105a472dc5eb239c68d7e13d8eef93c8dc0311be.tar.gz
Merge pull request #8084 from LemonBoy/fix-7905
Discriminate gensym'd type names in sigHash
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sighashes.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/sighashes.nim b/compiler/sighashes.nim
index 0b95387cd..0bf2b8459 100644
--- a/compiler/sighashes.nim
+++ b/compiler/sighashes.nim
@@ -189,18 +189,19 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) =
         c.hashTypeSym(t.sym)
       else:
         c.hashSym(t.sym)
-      if sfAnon in t.sym.flags:
+      if {sfAnon, sfGenSym} * t.sym.flags != {}:
         # generated object names can be identical, so we need to
         # disambiguate furthermore by hashing the field types and names:
         # mild hack to prevent endless recursions (makes nimforum compile again):
-        excl t.sym.flags, sfAnon
+        let oldFlags = t.sym.flags
+        t.sym.flags = t.sym.flags - {sfAnon, sfGenSym}
         let n = t.n
         for i in 0 ..< n.len:
           assert n[i].kind == nkSym
           let s = n[i].sym
           c.hashSym s
           c.hashType s.typ, flags
-        incl t.sym.flags, sfAnon
+        t.sym.flags = oldFlags
     else:
       c &= t.id
     if t.len > 0 and t.sons[0] != nil: