diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-09-14 22:28:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-14 22:28:12 +0200 |
commit | 0c04b80651ff591beadb873c8814168e66e6b722 (patch) | |
tree | add75ce87964ac299f102b9ff1ccfe8400c93fea /compiler | |
parent | 9995f50050298dc435a237b29dd0ff258ba25b9b (diff) | |
parent | 839953c3e167828f93bdddd27ae88c5909c8aca9 (diff) | |
download | Nim-0c04b80651ff591beadb873c8814168e66e6b722.tar.gz |
Merge pull request #8966 from LemonBoy/fix-8964
Fix hashing for codegenProc (sic) types
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/sighashes.nim | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/sighashes.nim b/compiler/sighashes.nim index 222a0d66e..218011b1d 100644 --- a/compiler/sighashes.nim +++ b/compiler/sighashes.nim @@ -68,6 +68,8 @@ else: toBase64a(cast[cstring](unsafeAddr u), sizeof(u)) proc `&=`(c: var MD5Context, s: string) = md5Update(c, s, s.len) proc `&=`(c: var MD5Context, ch: char) = md5Update(c, unsafeAddr ch, 1) + proc `&=`(c: var MD5Context, r: Rope) = + for l in leaves(r): md5Update(c, l, l.len) proc `&=`(c: var MD5Context, i: BiggestInt) = md5Update(c, cast[cstring](unsafeAddr i), sizeof(i)) @@ -185,11 +187,11 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) = # Every cyclic type in Nim need to be constructed via some 't.sym', so this # is actually safe without an infinite recursion check: if t.sym != nil: - #if "Future:" in t.sym.name.s and t.typeInst == nil: - # writeStackTrace() - # echo "yes ", t.sym.name.s - # #quit 1 - if CoOwnerSig in flags: + if {sfCompilerProc} * t.sym.flags != {}: + doAssert t.sym.loc.r != nil + # The user has set a specific name for this type + c &= t.sym.loc.r + elif CoOwnerSig in flags: c.hashTypeSym(t.sym) else: c.hashSym(t.sym) |