[Lldb-commits] [PATCH] D100800: [lldb] Fix demangler leaks in the DWARF AST parser

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 19 16:27:47 PDT 2021


shafik added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:1249
             attrs.is_inline);
+        free(buf);
 
----------------
MaskRay wrote:
> teemperor wrote:
> > `std::free` ?
> `std::` for C library functions is uncommon.
> 
> For some common functions (free,strcpy,memset,memcpy,...), the unqualified version is more common. I can find some `::foo` as well but `std::foo` is really rare.
In C++ we should be using `std::`. It seems we are not consistent in when we include the `.h` files instead of `cname` versions. 

So if we use the `cname` version e.g. `cstdlib` then it is unspecified if the functions are defined in the global namespace or not see [headers](http://eel.is/c++draft/headers#5.sentence-3).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100800



More information about the lldb-commits mailing list