Conversation
|
Looks highly plausible. Add / adapt a test to verify that this predicate in fact never worked? |
|
Why does this need a QL-level fix? The backslash character isn't special in a |
|
Or am I misremembering? Is backslash the escape character for |
Found it. However, the description doesn't state how single backslashes that aren't followed by backslash, underscore, or percent are interpreted. I'd expect them to match a single backslash, and not silently fail the entire match - if so, then the QL ought to have raised a warning. Given how few features a matches spec has, would it make sense to have all strings be valid input, i.e. allow such stray backslashes to match as if they were escaped? |
Backslash is indeed the escape character (see inmemory/src/com/semmle/inmemory/ast/RegexpUtils.java). |
There are a couple of points that need clarification here:
|
Ah, makes more sense to me now, then. I guess that late compiler warning will then simply be removed? Since the I don't have a strong opinion on the matter, but I think I slightly prefer removing the warning completely (and updating the documentation to state that solitary backslash works the same as an escaped backslash (assuming that it isn't followed by underscore or percent)). |
|
We have decided that it is easier to just support the existence of solitary backspaces in this context. |
I am working on a fix for https://github.com/github/codeql-core/issues/2038. Is this the appropriate fix for the problem?