<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">ok, good starting point then. We can submit another patch to add the find types by regex functionality.<div class=""><br class=""></div><div class="">Greg</div><div class=""><br class=""></div><div class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Dec 18, 2017, at 9:54 AM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">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 class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Dec 18, 2017 at 9:44 AM Greg Clayton via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="">reviews@reviews.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">clayborg added inline comments.<br class="">
<br class="">
<br class="">
================<br class="">
Comment at: source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp:393<br class="">
   // try really hard not to use a regex match.<br class="">
-  bool is_regex = false;<br class="">
-  if (name_str.find_first_of("[]?*.-+\\") != std::string::npos) {<br class="">
-    // Trying to compile an invalid regex could throw an exception.<br class="">
-    // Only search by regex when it's valid.<br class="">
-    lldb_private::RegularExpression name_regex(name_str);<br class="">
-    is_regex = name_regex.IsValid();<br class="">
-  }<br class="">
-  if (is_regex)<br class="">
-    FindTypesByRegex(name_str, max_matches, types);<br class="">
+  if (name_str.find_first_of("[]?*.-+\\") != std::string::npos)<br class="">
+    FindTypesByRegex(RegularExpression(name_str), max_matches, types);<br class="">
----------------<br class="">
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 class="">
<br class="">
<br class="">
Repository:<br class="">
  rL LLVM<br class="">
<br class="">
<a href="https://reviews.llvm.org/D41086" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D41086</a><br class="">
<br class="">
<br class="">
<br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>