[Lldb-commits] [PATCH] D74018: [lldb/LibCxx] Have ExtractLibcxxStringInfo return an Optional result, NFC

Vedant Kumar via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 12 11:19:38 PST 2020


vsk marked 2 inline comments as done.
vsk added inline comments.


================
Comment at: lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp:507
 
     size_mode_value = (size_mode->GetValueAsUnsigned(0));
     short_mode = ((size_mode_value & 0x80) == 0);
----------------
JDevlieghere wrote:
> Would it make sense to split the computation of `size_mode_value` and `short_mode` into a helper?
My 2c is that having this inline seems a little more readable, but I'm not strongly opposed.


================
Comment at: lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp:667
   options.SetStream(&stream);
-
-  if (prefix_token.empty())
-    options.SetPrefixToken(nullptr);
-  else
-    options.SetPrefixToken(prefix_token);
-
+  options.SetPrefixToken(prefix_token.empty() ? nullptr : prefix_token.c_str());
   options.SetQuote('"');
----------------
This causes some kind of use-after-free, I've backed this change out.


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

https://reviews.llvm.org/D74018





More information about the lldb-commits mailing list