-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What to do with the empty regex initializer? #23822
Comments
I'm ok with no-doc'ing it. The only use case I can think of is to create a dummy empty regex for a sentinel value or a dummy |
This initializer appears to be the An even better next step (separate from this issue) would be to add some better checking for this case within |
I would imagine this initializer comes up primarily with things like |
It seems like the general consensus is that this should stay in the public interface and be documented, and that we should fix the bug. The bug comes from a nullptr dereference in the re2 runtime shim, where |
Fixes multiple possible nullptr dereferences in the RE2 runtime shim, which could cause uninitialized `regex`s to segfault when used. Also documents the default initializer `regex.init(type exprType)`, which was publicly visible but had no docstring. ## Testing - Built docs locally - paratest with comm=none - paratest with comm=gasnet Resolves #23822 [Reviewed by @dlongnecke-cray]
While doing a pass through the standard modules for documented/public symbols missing docstrings, I came across this initializer in
Regex.regex
.This shows up in our docs, but its very easy to write surprising code that breaks with it. The following example compiles and runs, but then segfaults on
writeln(r)
inside c++std::string
. This is arguably a misuse of the code, in that we didn't really initialize anything so of course it segfaults, but there is no documentation on it.The only place I see this initializer being used is in the
regex.chpl__deserialize
. Is this useful to users? If not, can we just nodoc it? It was added in #14686 by @e-kayrakliAlso tagging @benharsh
The text was updated successfully, but these errors were encountered: