[Lldb-commits] [lldb] r282090 - Fix failing regex tests.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 21 10:13:51 PDT 2016


Author: zturner
Date: Wed Sep 21 12:13:51 2016
New Revision: 282090

URL: http://llvm.org/viewvc/llvm-project?rev=282090&view=rev
Log:
Fix failing regex tests.

r282079 converted the regular expression interface to accept
and return StringRefs instead of char pointers.  In one case
a null pointer check was converted to an empty string check,
but this was an incorrect conversion because an empty string
is a valid regular expression.  Removing this check should
fix the test failures.

Modified:
    lldb/trunk/source/Core/RegularExpression.cpp

Modified: lldb/trunk/source/Core/RegularExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegularExpression.cpp?rev=282090&r1=282089&r2=282090&view=diff
==============================================================================
--- lldb/trunk/source/Core/RegularExpression.cpp (original)
+++ lldb/trunk/source/Core/RegularExpression.cpp Wed Sep 21 12:13:51 2016
@@ -102,7 +102,7 @@ bool RegularExpression::Compile(llvm::St
 //---------------------------------------------------------------------
 bool RegularExpression::Execute(llvm::StringRef str, Match *match) const {
   int err = 1;
-  if (!str.empty() && m_comp_err == 0) {
+  if (m_comp_err == 0) {
     // Argument to regexec must be null-terminated.
     std::string reg_str = str;
     if (match) {




More information about the lldb-commits mailing list