summary refs log tree commit diff stats
path: root/compiler/ccgexprs.nim
diff options
context:
space:
mode:
authorJasper Jenkins <jasper.vs.jenkins@gmail.com>2020-01-05 00:18:14 -0800
committerAndreas Rumpf <rumpf_a@web.de>2020-01-05 09:18:14 +0100
commit9474a818afa95f682d1255e74fae1681a2b4f1de (patch)
treea68672362216c70d06f71aed3b5369f9cdf26c3a /compiler/ccgexprs.nim
parent13c08f3ab4db3cc7b162af383a74c4fc09f0c378 (diff)
downloadNim-9474a818afa95f682d1255e74fae1681a2b4f1de.tar.gz
fix enumtostr crash for enum-range (#13035)
Diffstat (limited to 'compiler/ccgexprs.nim')
-rw-r--r--compiler/ccgexprs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index 8c41fb370..6d5f25567 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -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: