diff options
author | LemonBoy <thatlemon@gmail.com> | 2018-06-22 15:09:35 +0200 |
---|---|---|
committer | LemonBoy <thatlemon@gmail.com> | 2018-06-22 19:47:44 +0200 |
commit | e39baf46fc523245a7d73b263808b944c6f225db (patch) | |
tree | 6b8ec4757b539f28fe2ca9473c7bfa51242661a6 /compiler | |
parent | af66258dca695d932e76ea31bdee2b2f185139cb (diff) | |
download | Nim-e39baf46fc523245a7d73b263808b944c6f225db.tar.gz |
Don't blow up with recursive objects
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sighashes.nim | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/sighashes.nim b/compiler/sighashes.nim index 720d1848d..0bf2b8459 100644 --- a/compiler/sighashes.nim +++ b/compiler/sighashes.nim @@ -193,16 +193,15 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) = # 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): - let wasAnon = sfAnon in t.sym.flags - 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 - if wasAnon: - incl t.sym.flags, sfAnon + t.sym.flags = oldFlags else: c &= t.id if t.len > 0 and t.sons[0] != nil: |