fix #17836 (typed macro isNil for proc params) (#17841)

thanks @alaviss for the test
This commit is contained in:
Saem Ghani 2021-04-25 01:30:52 -07:00 • committed by GitHub
commit 17db15f9b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -1513,8 +1513,8 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
# reference with the value `nil`, so `isNil` should be false!
(node.kind == nkNilLit and nfIsRef notin node.flags) or
(not node.typ.isNil and node.typ.kind == tyProc and
node.typ.callConv == ccClosure and node[0].kind == nkNilLit and
node[1].kind == nkNilLit))
node.typ.callConv == ccClosure and node.safeLen > 0 and
node[0].kind == nkNilLit and node[1].kind == nkNilLit))
of opcNBindSym:
# cannot use this simple check
# if dynamicBindSym notin c.config.features: