Remove arbitrary limits in Starlark "while" loops (#862)

This commit is contained in:
Fabian Meumertzheim 2022-01-21 22:05:18 +01:00 committed by GitHub
parent e24d9cecfe
commit 50ee9979e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -123,8 +123,7 @@ def replace_var_ref(text, shell_context):
parts = []
current = text
# long enough
for i in range(1, 100):
for i in range(2147483647):
(before, varname, after) = extract_wrapped(current, "$$")
if not varname:
parts.append(current)
@ -199,8 +198,7 @@ def split_arguments(text):
parts = []
current = text.strip(" ")
# long enough
for i in range(1, 100):
for i in range(1, 2147483647):
if not current:
break