<div dir="ltr">I agree that's better long term, but this code was already there, and the patch makes things strictly better than before (literally just fixes a crash in existing code).  So I think we can agree that this should be fixed, but as it's a bigger change I don't think it should hold up fixing a crash.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 18, 2017 at 9:44 AM Greg Clayton via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">clayborg added inline comments.<br>
<br>
<br>
================<br>
Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:393<br>
   // try really hard not to use a regex match.<br>
-  bool is_regex = false;<br>
-  if (name_str.find_first_of("[]?*.-+\\") != std::string::npos) {<br>
-    // Trying to compile an invalid regex could throw an exception.<br>
-    // Only search by regex when it's valid.<br>
-    lldb_private::RegularExpression name_regex(name_str);<br>
-    is_regex = name_regex.IsValid();<br>
-  }<br>
-  if (is_regex)<br>
-    FindTypesByRegex(name_str, max_matches, types);<br>
+  if (name_str.find_first_of("[]?*.-+\\") != std::string::npos)<br>
+    FindTypesByRegex(RegularExpression(name_str), max_matches, types);<br>
----------------<br>
I would rather not sniff the string passed in to see if this could be a regex and add a new FindTypesByRegex() call to lldb_private::SymbolFile that anyone can use. Do we have PDB tests that are using this functionality?<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D41086" rel="noreferrer" target="_blank">https://reviews.llvm.org/D41086</a><br>
<br>
<br>
<br>
</blockquote></div>