[Lldb-commits] [PATCH] D72086: [lldb] Fix that SBThread.GetStopDescription is returning strings with uninitialized memory at the end.

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 8 03:49:12 PST 2020


teemperor marked an inline comment as done.
teemperor added inline comments.


================
Comment at: lldb/scripts/Python/python-typemaps.swig:124-125
    } else {
-      llvm::StringRef ref(static_cast<const char*>($1), result);
+      const char *cstr = static_cast<const char*>($1);
+      llvm::StringRef ref(cstr, strlen(cstr));
       PythonString string(ref);
----------------
labath wrote:
> This is just `StringRef ref = $1`, right ?
Swig gives $1 a void* type (at least on my system), so I we still need the `static_cast` (but we can get rid of the rest).


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

https://reviews.llvm.org/D72086





More information about the lldb-commits mailing list