[Lldb-commits] [PATCH] D62334: [lldb] Make sure RegularExpression constructors always initialize member variables

Jorge Gorbe Moya via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 23 11:39:28 PDT 2019


jgorbe updated this revision to Diff 201029.
jgorbe added a comment.

Fixed indentation.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62334/new/

https://reviews.llvm.org/D62334

Files:
  lldb/source/Utility/RegularExpression.cpp


Index: lldb/source/Utility/RegularExpression.cpp
===================================================================
--- lldb/source/Utility/RegularExpression.cpp
+++ lldb/source/Utility/RegularExpression.cpp
@@ -29,13 +29,12 @@
 // Constructor that compiles "re" using "flags" and stores the resulting
 // compiled regular expression into this object.
 RegularExpression::RegularExpression(llvm::StringRef str)
-    : m_re(), m_comp_err(1), m_preg() {
-  memset(&m_preg, 0, sizeof(m_preg));
+    : RegularExpression() {
   Compile(str);
 }
 
-RegularExpression::RegularExpression(const RegularExpression &rhs) {
-  memset(&m_preg, 0, sizeof(m_preg));
+RegularExpression::RegularExpression(const RegularExpression &rhs)
+    : RegularExpression() {
   Compile(rhs.GetText());
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62334.201029.patch
Type: text/x-patch
Size: 781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190523/b64ebe62/attachment.bin>


More information about the lldb-commits mailing list