[PATCH] D39461: [scudo] Implement stricter separation of C vs C++

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 10:36:31 PDT 2017


cryptoad created this revision.
Herald added subscribers: mgorny, srhines.

Initially, Scudo had a monolithic design where both C and C++ functions were
living in the same library. This was not necessarily ideal, and with the work
on -fsanitize=scudo, it became more apparent that this needed to change.

We are splitting the new/delete interceptor in their own C++ library. This
allows more flexibility, notably with regard to std::bad_alloc when the work is
done. This also allows us to not link new & delete when using pure C.

Additionally, we add the UBSan runtimes with Scudo, in order to be able to have
a -fsanitize=scudo,undefined in Clang (see work in https://reviews.llvm.org/D39334).

The changes in this patch:

- split the cxx specific code in the scudo cmake file into a new library; (remove the spurious foreach loop, that was not necessary)
- add the UBSan runtimes (both C and C++);
- change the test cmake file to allow for specific C & C++ tests;
- make C tests pure C, rename their extension accordingly.


https://reviews.llvm.org/D39461

Files:
  lib/scudo/CMakeLists.txt
  test/scudo/alignment.c
  test/scudo/alignment.cpp
  test/scudo/double-free.cpp
  test/scudo/interface.cpp
  test/scudo/lit.cfg
  test/scudo/malloc.cpp
  test/scudo/memalign.c
  test/scudo/memalign.cpp
  test/scudo/mismatch.cpp
  test/scudo/options.cpp
  test/scudo/overflow.c
  test/scudo/overflow.cpp
  test/scudo/preinit.c
  test/scudo/preinit.cpp
  test/scudo/preload.c
  test/scudo/preload.cpp
  test/scudo/quarantine.c
  test/scudo/quarantine.cpp
  test/scudo/random_shuffle.cpp
  test/scudo/realloc.cpp
  test/scudo/secondary.c
  test/scudo/secondary.cpp
  test/scudo/sized-delete.cpp
  test/scudo/sizes.cpp
  test/scudo/threads.c
  test/scudo/threads.cpp
  test/scudo/tsd_destruction.c
  test/scudo/tsd_destruction.cpp
  test/scudo/valloc.c
  test/scudo/valloc.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39461.121013.patch
Type: text/x-patch
Size: 30134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171031/46fa18b8/attachment.bin>


More information about the llvm-commits mailing list