ORC: critical bugfix for mixing acyclic refs with cyclic refs [backport:1.4] (#17991)

This commit is contained in:
Andreas Rumpf 2021-05-11 16:21:29 +02:00 • committed by GitHub
commit 2c2ec48bc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View file

@ -381,7 +381,8 @@ proc isFinal*(t: PType): bool =
proc canFormAcycle*(typ: PType): bool =
var marker = initIntSet()
result = canFormAcycleAux(marker, typ, typ.id)
let t = skipTypes(typ, abstractInst+{tyOwned}-{tyTypeDesc})
result = canFormAcycleAux(marker, t, t.id)
proc mutateTypeAux(marker: var IntSet, t: PType, iter: TTypeMutator,
closure: RootRef): PType