Fix segfault caused by ensuring valueless statics are not evaluated (#21577)

(cherry picked from commit c06623bf8c)
This commit is contained in:
Jason Beetham
2023-03-28 20:50:56 -06:00
committed by narimiran
parent 21a26548a4
commit 9bc30a1ff8
2 changed files with 21 additions and 1 deletions

View File

@@ -201,7 +201,7 @@ proc hasValuelessStatics(n: PNode): bool =
proc doThing(_: MyThing)
]#
if n.safeLen == 0:
n.typ.kind == tyStatic
n.typ == nil or n.typ.kind == tyStatic
else:
for x in n:
if hasValuelessStatics(x):