summary refs log tree commit diff stats
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2024-09-29 11:20:38 +0300
committerGitHub <noreply@github.com>2024-09-29 10:20:38 +0200
commit7cbe031909e90ae7896aee49382455f428a5c52a (patch)
treef0e5bd5c578f977cf040b9201f84eb49126c6bda
parent4f5c0efaf24e863b26b16d7998eac3bdd830e7be (diff)
downloadNim-7cbe031909e90ae7896aee49382455f428a5c52a.tar.gz
fix trivial segfault in sigmatch for static types (#24196)
refs #7382, caused by #24005
-rw-r--r--compiler/sigmatch.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index f09fd6b69..844db3209 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -2012,7 +2012,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
             var r = tryResolvingStaticExpr(c, f.n)
             if r == nil: r = f.n
             if not exprStructuralEquivalent(r, aOrig.n) and
-                not (aOrig.n.kind == nkIntLit and
+                not (aOrig.n != nil and aOrig.n.kind == nkIntLit and
                   inferStaticParam(c, r, aOrig.n.intVal)):
               result = isNone
         elif f.base.kind == tyGenericParam: