fix enumtostr crash for enum-range (#13035)
This commit is contained in:
parent
13c08f3ab4
commit
9474a818af
2 changed files with 13 additions and 1 deletions
|
|
@ -2070,7 +2070,7 @@ proc genDispose(p: BProc; n: PNode) =
|
|||
|
||||
proc genEnumToStr(p: BProc, e: PNode, d: var TLoc) =
|
||||
const ToStringProcSlot = -4
|
||||
let t = e[1].typ.skipTypes(abstractInst)
|
||||
let t = e[1].typ.skipTypes(abstractInst+{tyRange})
|
||||
var toStrProc: PSym = nil
|
||||
for idx, p in items(t.methods):
|
||||
if idx == ToStringProcSlot:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue