From be34e323e55972dd56f86f73ca488b83cc1da13f Mon Sep 17 00:00:00 2001 From: elelel Date: Sat, 16 Oct 2021 23:00:17 +0000 Subject: [PATCH] Fix indexing into an empty array Signed-off-by: elelel --- tools/circular_includes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/circular_includes.py b/tools/circular_includes.py index d3d448d55..9ee240013 100755 --- a/tools/circular_includes.py +++ b/tools/circular_includes.py @@ -58,7 +58,7 @@ def main(parse_args): file_stack.append(header) else: # popped back up to an earlier header - while file_stack[-1] != header: + while (len(file_stack) > 0) and (file_stack[-1] != header): file_stack.pop() return 0