Fix infinite loop in resolveTypeOfNode

This commit is contained in:
Alexandros Naskos 2020-05-24 21:01:35 +03:00
parent d6513456c1
commit 727b363f7f

View File

@ -294,6 +294,7 @@ pub fn resolveTypeOfNode(analysis_ctx: *AnalysisContext, node: *ast.Node) ?*ast.
}, },
.Identifier => { .Identifier => {
if (getChildOfSlice(analysis_ctx.tree(), analysis_ctx.scope_nodes, analysis_ctx.tree().getNodeSource(node))) |child| { if (getChildOfSlice(analysis_ctx.tree(), analysis_ctx.scope_nodes, analysis_ctx.tree().getNodeSource(node))) |child| {
if (child == node) return null;
return resolveTypeOfNode(analysis_ctx, child); return resolveTypeOfNode(analysis_ctx, child);
} else return null; } else return null;
}, },