From 727b363f7f9f2bb5a1b08dd310a76958da5ff4ae Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Sun, 24 May 2020 21:01:35 +0300 Subject: [PATCH] Fix infinite loop in resolveTypeOfNode --- src/analysis.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/analysis.zig b/src/analysis.zig index 749357b..f2caf5e 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -294,6 +294,7 @@ pub fn resolveTypeOfNode(analysis_ctx: *AnalysisContext, node: *ast.Node) ?*ast. }, .Identifier => { 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); } else return null; },