Skip to content

Commit

Permalink
analyzer: fix ScopeTree.remove_symbols_by_line infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nedpals committed Jul 5, 2022
1 parent 58b5a69 commit 7610a0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion analyzer/scope.v
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ pub fn (mut scope ScopeTree) remove_symbols_by_line(start_line u32, end_line u32
end_byte := scope.children[i].start_byte
should_delete := scope.children[i].remove_symbols_by_line(start_line, end_line)
if should_delete {
scope.remove_child(start_byte, end_byte)
scope.children[i].remove_child(start_byte, end_byte)
scope.children.delete(i)
} else {
i++
}
Expand Down

0 comments on commit 7610a0a

Please sign in to comment.