v.markused: improve stability (avoid runtime crash) when processing generic functions (partial fix for #23927)

This commit is contained in:
Delyan Angelov 2025-03-14 07:01:55 +02:00
parent 62ba811534
commit 8c92e3d0c5
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -599,6 +599,9 @@ pub fn (mut w Walker) a_struct_info(sname string, info ast.Struct) {
}
pub fn (mut w Walker) fn_decl(mut node ast.FnDecl) {
if node == unsafe { nil } {
return
}
if node.language == .c {
w.mark_fn_as_used(node.fkey())
return
@ -616,6 +619,9 @@ pub fn (mut w Walker) fn_decl(mut node ast.FnDecl) {
}
pub fn (mut w Walker) call_expr(mut node ast.CallExpr) {
if node == unsafe { nil } {
return
}
for arg in node.args {
w.expr(arg.expr)
}