Leak detector: give more info for anon ref objects
This commit is contained in:
parent
17becb8d30
commit
00a230e5d8
1 changed files with 4 additions and 1 deletions
|
|
@ -968,8 +968,11 @@ proc genTypeInfoAuxBase(m: BModule; typ, origType: PType;
|
||||||
addf(m.s[cfsTypeInit3], "$1.flags = $2;$n", [name, rope(flags)])
|
addf(m.s[cfsTypeInit3], "$1.flags = $2;$n", [name, rope(flags)])
|
||||||
discard cgsym(m, "TNimType")
|
discard cgsym(m, "TNimType")
|
||||||
if isDefined("nimTypeNames"):
|
if isDefined("nimTypeNames"):
|
||||||
|
var typename = typeToString(origType, preferName)
|
||||||
|
if typename == "ref object" and origType.skipTypes(skipPtrs).sym != nil:
|
||||||
|
typename = "anon ref object from " & $origType.skipTypes(skipPtrs).sym.info
|
||||||
addf(m.s[cfsTypeInit3], "$1.name = $2;$n",
|
addf(m.s[cfsTypeInit3], "$1.name = $2;$n",
|
||||||
[name, makeCstring typeToString(origType, preferName)])
|
[name, makeCstring typename])
|
||||||
discard cgsym(m, "nimTypeRoot")
|
discard cgsym(m, "nimTypeRoot")
|
||||||
addf(m.s[cfsTypeInit3], "$1.nextType = nimTypeRoot; nimTypeRoot=&$1;$n",
|
addf(m.s[cfsTypeInit3], "$1.nextType = nimTypeRoot; nimTypeRoot=&$1;$n",
|
||||||
[name])
|
[name])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue