[Lldb-commits] [PATCH] D50473: [Demangle] Add another test for ItaniumPartialDemangler

Stefan Gränitz via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 8 15:35:51 PDT 2018


sgraenitz added inline comments.


================
Comment at: unittests/Demangle/PartialDemangleTest.cpp:188
+    size_t N = OriginalSize;
+    char *Res = D.getFunctionName(Buf, &N);
+    EXPECT_EQ(nullptr, Res);
----------------
erik.pilkington wrote:
> Does LLDB actually pass in a N that is less than the length of Buf? Its not wrong to do that per se, realloc will sort it out, but it seems kinda strange.
My first version used only one variable for N, so the pretended buffer size was decreasing continuously while the actual buffer remained unchanged.. That caused unnecessary allocations. I fixed that a few days ago. Basically it's these three cases to consider:
https://github.com/llvm-mirror/lldb/blob/a063373af4d295e48017ca218d1030aac13b0af5/source/Core/RichManglingContext.cpp#L91


Repository:
  rL LLVM

https://reviews.llvm.org/D50473





More information about the lldb-commits mailing list