move recursion check up to fix tectype regression
This commit is contained in:
parent
1c20046f28
commit
a173703015
1 changed files with 7 additions and 5 deletions
|
|
@ -565,17 +565,19 @@ const
|
||||||
proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet): Rope =
|
proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet): Rope =
|
||||||
# returns only the type's name
|
# returns only the type's name
|
||||||
var t = origTyp.skipTypes(irrelevantForBackend)
|
var t = origTyp.skipTypes(irrelevantForBackend)
|
||||||
if t.sym != nil: useHeader(m, t.sym)
|
|
||||||
if t != origTyp and origTyp.sym != nil: useHeader(m, origTyp.sym)
|
|
||||||
let sig = hashType(origTyp)
|
|
||||||
result = getTypePre(m, t, sig)
|
|
||||||
if result != nil: return
|
|
||||||
if containsOrIncl(check, t.id):
|
if containsOrIncl(check, t.id):
|
||||||
if not (isImportedCppType(origTyp) or isImportedCppType(t)):
|
if not (isImportedCppType(origTyp) or isImportedCppType(t)):
|
||||||
internalError("cannot generate C type for: " & typeToString(origTyp))
|
internalError("cannot generate C type for: " & typeToString(origTyp))
|
||||||
# XXX: this BUG is hard to fix -> we need to introduce helper structs,
|
# XXX: this BUG is hard to fix -> we need to introduce helper structs,
|
||||||
# but determining when this needs to be done is hard. We should split
|
# but determining when this needs to be done is hard. We should split
|
||||||
# C type generation into an analysis and a code generation phase somehow.
|
# C type generation into an analysis and a code generation phase somehow.
|
||||||
|
if t.sym != nil: useHeader(m, t.sym)
|
||||||
|
if t != origTyp and origTyp.sym != nil: useHeader(m, origTyp.sym)
|
||||||
|
let sig = hashType(origTyp)
|
||||||
|
result = getTypePre(m, t, sig)
|
||||||
|
if result != nil:
|
||||||
|
excl(check, t.id)
|
||||||
|
return
|
||||||
case t.kind
|
case t.kind
|
||||||
of tyRef, tyPtr, tyVar:
|
of tyRef, tyPtr, tyVar:
|
||||||
var star = if t.kind == tyVar and tfVarIsPtr notin origTyp.flags and
|
var star = if t.kind == tyVar and tfVarIsPtr notin origTyp.flags and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue