Skip to content

Commit

Permalink
fix nim-lang#14340, use safeLen instead of len
Browse files Browse the repository at this point in the history
  • Loading branch information
narimiran committed Nov 28, 2020
1 parent 157e782 commit 945ef25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3089,7 +3089,7 @@ proc genBracedInit(p: BProc, n: PNode; isConst: bool; optionalType: PType): Rope
else:
result = genConstSeq(p, n, typ, isConst)
of tyProc:
if typ.callConv == ccClosure and n.len > 1 and n[1].kind == nkNilLit:
if typ.callConv == ccClosure and n.safeLen > 1 and n[1].kind == nkNilLit:
# Conversion: nimcall -> closure.
# this hack fixes issue that nkNilLit is expanded to {NIM_NIL,NIM_NIL}
# this behaviour is needed since closure_var = nil must be
Expand Down

0 comments on commit 945ef25

Please sign in to comment.