[develop] String:findRegexp handles empty results incorrectly #4239
Labels
bug
Issues that relate to unexpected/unwanted behavior. Don't use for PRs.
comp: sclang
sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
Environment
Steps to reproduce (for bugs)
Expected Behavior
If
String:findRegexp
doesn't find any matches, it should return an empty array.Current Behavior
Between 3.10 and develop, the behavior changed so that an empty result returns the regular expression as a string.
https://github.com/supercollider/supercollider/blame/develop/lang/LangPrimSource/PyrStringPrim.cpp#L416
^^ I'm guessing this is the issue. Right above this line, there is something new to advance the stack (comment says "to avoid overwriting receiver"). But if the match result is empty, now we simply return without un-advancing the stack -- so the returned result is wrong.
I suppose the fix is trivial, but I am not good with GC details.
User impact: I use
findRegexp
extensively in ddwChucklib-livecode. It's impossible to evaluate any cll statements in the current develop branch.The text was updated successfully, but these errors were encountered: