[libcxx-commits] [PATCH] D58011: Fix -fsanitize=vptr badness in <__debug>

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 10 11:40:58 PST 2019


EricWF marked 4 inline comments as done.
EricWF added inline comments.


================
Comment at: include/__debug:253
 
+    using _InsertConstruct  = __c_node*(void*, void*, __c_node*);
+
----------------
mclow.lists wrote:
> When did `using` replace `typedef`? Pretty sure it was post C++11
`using` is C++11. But this header still pretends to have C++03 support so I'll write it as a `typedef`.


================
Comment at: src/debug.cpp:237
     __c_node* p = __cbeg_[hc];
-    __c_node* r = __cbeg_[hc] =
-      static_cast<__c_node*>(malloc(sizeof(__c_node)));
-    if (__cbeg_[hc] == nullptr)
-        __throw_bad_alloc();
-
+    void *buf = malloc(sizeof(__c_node));
+    if (buf == nullptr)
----------------
mclow.lists wrote:
> This also appears to fix a bug where a memory allocation failure would corrupt the debug database.
Cool!


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

https://reviews.llvm.org/D58011





More information about the libcxx-commits mailing list