next attempt to fix #4272

This commit is contained in:
Andreas Rumpf 2016-06-05 20:19:06 +02:00
commit 69966a7110

View file

@ -573,13 +573,13 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var IntSet): Rope =
result = getTypeDescWeak(m, t.sons[0], check) & "*" result = getTypeDescWeak(m, t.sons[0], check) & "*"
idTablePut(m.typeCache, t, result) idTablePut(m.typeCache, t, result)
of tyRange, tyEnum: of tyRange, tyEnum:
let orig = t
let t = if t.kind == tyRange: t.lastSon else: t let t = if t.kind == tyRange: t.lastSon else: t
result = cacheGetType(m.typeCache, t)
if result == nil:
result = getTypeName(t) result = getTypeName(t)
if not (isImportedCppType(t) or if not (isImportedCppType(t) or
(sfImportc in t.sym.flags and t.sym.magic == mNone)): (sfImportc in t.sym.flags and t.sym.magic == mNone)):
idTablePut(m.typeCache, t, result) idTablePut(m.typeCache, t, result)
if t != orig: idTablePut(m.typeCache, orig, result)
var size: int var size: int
if firstOrd(t) < 0: if firstOrd(t) < 0:
addf(m.s[cfsTypes], "typedef NI32 $1;$n", [result]) addf(m.s[cfsTypes], "typedef NI32 $1;$n", [result])