fix(tvix/eval): handle builtins.split matching the empty string
This prevents the following statements from looping endlessly: ``` builtins.split "(.*)" "" builtins.split "([abc]*)" "abc" builtins.split "(.*)" "abc" builtins.split ".*" "" ``` Cover these (and some more examples) in the test suite. Co-Authored-By: Florian Klink <flokli@flokli.de> Change-Id: Ibd339f971e0f4e3e5c229816e2be5a8e3836fec9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11743 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
154e0d71e0
commit
beb7f57c73
4 changed files with 15 additions and 1 deletions
|
|
@ -1286,6 +1286,9 @@ mod pure_builtins {
|
|||
})
|
||||
.collect();
|
||||
ret.push_back(Value::List(NixList::from(v)));
|
||||
if pos == text.len() {
|
||||
break;
|
||||
}
|
||||
pos = thematch.end();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue