sighashes: do not use the ID mechanism at all

This commit is contained in:
Araq 2016-12-13 09:22:20 +01:00
commit 71a23fbbb7
3 changed files with 56 additions and 11 deletions

View file

@ -175,6 +175,8 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) =
c.hashType s.typ, flags
else:
c &= t.id
if t.len > 0 and t.sons[0] != nil:
hashType c, t.sons[0], flags
of tyRef, tyPtr, tyGenericBody, tyVar:
c.hashType t.lastSon, flags
if tfVarIsPtr in t.flags: c &= ".varisptr"
@ -267,6 +269,17 @@ proc hashProc*(s: PSym): SigHash =
#c &= s.info.line
md5Final c, result.Md5Digest
proc hashNonProc*(s: PSym): SigHash =
var c: MD5Context
md5Init c
hashSym(c, s)
var it = s
while it != nil:
c &= it.name.s
c &= "."
it = it.owner
md5Final c, result.Md5Digest
proc hashOwner*(s: PSym): SigHash =
var c: MD5Context
md5Init c