Fixed infinite loop
This commit is contained in:
parent
5e7fc18404
commit
6c718a59c4
@ -580,6 +580,10 @@ fn resolveTypeOfNodeInternal(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (try lookupSymbolGlobal(store, arena, handle, handle.tree.getNodeSource(node), handle.tree.token_locs[node.firstToken()].start)) |child| {
|
if (try lookupSymbolGlobal(store, arena, handle, handle.tree.getNodeSource(node), handle.tree.token_locs[node.firstToken()].start)) |child| {
|
||||||
|
switch(child.decl.*) {
|
||||||
|
.ast_node => |n| if (n == node) return null,
|
||||||
|
else => {},
|
||||||
|
}
|
||||||
return try child.resolveType(store, arena, bound_type_params);
|
return try child.resolveType(store, arena, bound_type_params);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -254,21 +254,24 @@ fn writeNodeTokens(builder: *Builder, arena: *std.heap.ArenaAllocator, store: *D
|
|||||||
return try writeToken(builder, node.firstToken(), .parameter);
|
return try writeToken(builder, node.firstToken(), .parameter);
|
||||||
}
|
}
|
||||||
// TODO: Clean this up.
|
// TODO: Clean this up.
|
||||||
// @TODO This stack overflows
|
var bound_type_params = analysis.BoundTypeParams.init(&arena.allocator);
|
||||||
// var bound_type_params = analysis.BoundTypeParams.init(&arena.allocator);
|
|
||||||
// if (try child.resolveType(store, arena, &bound_type_params)) |decl_type| {
|
var resolve_type_frame = try arena.child_allocator.alignedAlloc(u8, std.Target.stack_align, @sizeOf(@Frame(analysis.DeclWithHandle.resolveType)));
|
||||||
// if (decl_type.type.is_type_val) {
|
defer arena.child_allocator.free(resolve_type_frame);
|
||||||
// const tok_type = if (decl_type.isStructType())
|
|
||||||
// .@"struct"
|
if (try child.resolveType(store, arena, &bound_type_params)) |decl_type| {
|
||||||
// else if (decl_type.isEnumType())
|
if (decl_type.type.is_type_val) {
|
||||||
// .@"enum"
|
const tok_type = if (decl_type.isStructType())
|
||||||
// else if (decl_type.isUnionType())
|
.@"struct"
|
||||||
// .@"union"
|
else if (decl_type.isEnumType())
|
||||||
// else
|
.@"enum"
|
||||||
// TokenType.type;
|
else if (decl_type.isUnionType())
|
||||||
// return try writeTokenMod(builder, node.firstToken(), tok_type, .{});
|
.@"union"
|
||||||
// }
|
else
|
||||||
// }
|
TokenType.type;
|
||||||
|
return try writeTokenMod(builder, node.firstToken(), tok_type, .{});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
.FnProto => {
|
.FnProto => {
|
||||||
|
Loading…
Reference in New Issue
Block a user