Fix segfault with var params
This commit is contained in:
parent
727b363f7f
commit
7c5ff5c43d
@ -578,7 +578,8 @@ pub fn declsFromIndexInternal(
|
|||||||
|
|
||||||
// TODO: This is a hack to enable param decls with the new parser
|
// TODO: This is a hack to enable param decls with the new parser
|
||||||
for (func.paramsConst()) |param| {
|
for (func.paramsConst()) |param| {
|
||||||
if (param.name_token) |name_token| {
|
if (param.param_type != .type_expr) continue;
|
||||||
|
if (param.name_token) |name_token| {
|
||||||
const var_decl_node = try arena.allocator.create(ast.Node.VarDecl);
|
const var_decl_node = try arena.allocator.create(ast.Node.VarDecl);
|
||||||
var_decl_node.* = .{
|
var_decl_node.* = .{
|
||||||
.doc_comments = param.doc_comments,
|
.doc_comments = param.doc_comments,
|
||||||
@ -592,7 +593,7 @@ pub fn declsFromIndexInternal(
|
|||||||
.lib_name = null,
|
.lib_name = null,
|
||||||
.type_node = switch (param.param_type) {
|
.type_node = switch (param.param_type) {
|
||||||
.type_expr => |t| t,
|
.type_expr => |t| t,
|
||||||
else => null,
|
else => unreachable,
|
||||||
},
|
},
|
||||||
.align_node = null,
|
.align_node = null,
|
||||||
.section_node = null,
|
.section_node = null,
|
||||||
|
Loading…
Reference in New Issue
Block a user