Skip to content

Commit 8c92e3d

Browse files
committed
v.markused: improve stability (avoid runtime crash) when processing generic functions (partial fix for #23927)
1 parent 62ba811 commit 8c92e3d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎vlib/v/markused/walker.v‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,9 @@ pub fn (mut w Walker) a_struct_info(sname string, info ast.Struct) {
599599
}
600600

601601
pub fn (mut w Walker) fn_decl(mut node ast.FnDecl) {
602+
if node == unsafe { nil } {
603+
return
604+
}
602605
if node.language == .c {
603606
w.mark_fn_as_used(node.fkey())
604607
return
@@ -616,6 +619,9 @@ pub fn (mut w Walker) fn_decl(mut node ast.FnDecl) {
616619
}
617620

618621
pub fn (mut w Walker) call_expr(mut node ast.CallExpr) {
622+
if node == unsafe { nil } {
623+
return
624+
}
619625
for arg in node.args {
620626
w.expr(arg.expr)
621627
}

0 commit comments

Comments
 (0)