1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: fix segfault in vls for struct field declarations, having custom initializers with fn calls (#9741)

This commit is contained in:
Jarred Sumner 2021-04-14 22:49:25 -07:00 committed by GitHub
parent c2227addff
commit 9d6caa1d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2062,7 +2062,7 @@ pub fn (mut c Checker) fn_call(mut call_expr ast.CallExpr) ast.Type {
&& func.mod != c.mod { && func.mod != c.mod {
c.error('function `$func.name` is private', call_expr.pos) c.error('function `$func.name` is private', call_expr.pos)
} }
if !c.cur_fn.is_deprecated && func.is_deprecated { if c.cur_fn != 0 && !c.cur_fn.is_deprecated && func.is_deprecated {
c.deprecate_fnmethod('function', func.name, func, call_expr) c.deprecate_fnmethod('function', func.name, func, call_expr)
} }
if func.is_unsafe && !c.inside_unsafe if func.is_unsafe && !c.inside_unsafe