From 4b377b07fcec623b8387ed20f6c1cada20979053 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Wed, 26 Oct 2022 02:08:36 +0800 Subject: fixes #19201; fixes sink causes crash in VM (#20658) --- compiler/vmgen.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/vmgen.nim') diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 56764ef94..dbe053030 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1060,7 +1060,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) = of mLengthOpenArray, mLengthArray, mLengthSeq: genUnaryABI(c, n, dest, opcLenSeq) of mLengthStr: - case n[1].typ.kind + case n[1].typ.skipTypes(abstractVarRange).kind of tyString: genUnaryABI(c, n, dest, opcLenStr) of tyCstring: genUnaryABI(c, n, dest, opcLenCstring) else: doAssert false, $n[1].typ.kind -- cgit 1.4.1-2-gfad0