[Lldb-commits] [lldb] 93a1e9c - [lldb/SWIG] Add missing '\' in macros again

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 9 08:15:56 PST 2020


Author: Jonas Devlieghere
Date: 2020-01-09T08:15:41-08:00
New Revision: 93a1e9c90c96a9130352bf358d7777f0379ebb48

URL: https://github.com/llvm/llvm-project/commit/93a1e9c90c96a9130352bf358d7777f0379ebb48
DIFF: https://github.com/llvm/llvm-project/commit/93a1e9c90c96a9130352bf358d7777f0379ebb48.diff

LOG: [lldb/SWIG] Add missing '\' in macros again

Making the string conversion operator a macro unintentionally dropped
the backslash before '\n' and '\r' and was therefore incorrectly
stripping 'n' and 'r' from the object description.

Added: 
    

Modified: 
    lldb/scripts/macros.swig

Removed: 
    


################################################################################
diff  --git a/lldb/scripts/macros.swig b/lldb/scripts/macros.swig
index e0756c2f1793..0387f27f3cb9 100644
--- a/lldb/scripts/macros.swig
+++ b/lldb/scripts/macros.swig
@@ -6,7 +6,7 @@
     $self->GetDescription (stream, Level);
     const char *desc = stream.GetData();
     size_t desc_len = stream.GetSize();
-    if (desc_len > 0 && (desc[desc_len-1] == 'n' || desc[desc_len-1] == 'r')) {
+    if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) {
       --desc_len;
     }
     return std::string(desc, desc_len);
@@ -23,7 +23,7 @@
     $self->GetDescription (stream);
     const char *desc = stream.GetData();
     size_t desc_len = stream.GetSize();
-    if (desc_len > 0 && (desc[desc_len-1] == 'n' || desc[desc_len-1] == 'r')) {
+    if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r')) {
       --desc_len;
     }
     return std::string(desc, desc_len);


        


More information about the lldb-commits mailing list