[PATCH] D42644: [asan] Intercept std::rethrow_exception indirectly.

Kuba (Brecka) Mracek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 1 10:24:33 PST 2018


kubamracek added a comment.

> This is our first patch so we're unfamiliar with the LLVM testing infrastructure. Could you please tell us what kind of test you'd like? An example would also be great.

Thank you for your first contribution! I'm going to comment on the testing infrastructure only, as I don't know the answer to the portability/mangling/ABI question.

Most user-visible features of ASan can usually be demonstrated in a single-file test that is completely standalone test program. E.g. ASan's ability to detect heap buffer overflows is demonstrated in `test/asan/TestCases/heap-overflow.cc` file. Notice that these tests don't include or reference any sanitizer internal functions. They are meant to be written in a way that user's code is written. Can you try adding such a test, which would be a standalone .cc file that would demonstrate the problematic scenario (C++ exception rethrow) without including ASan headers? The test's expectation should be that ASan doesn't report any issues, whereas without your patch, the test fails (or might fail). For an example of a negative test (that checks that ASan *doesn't* report any issues), see `test/asan/TestCases/Darwin/nil-return-struct.mm`.

If the test should work on all ASan supported platforms, put it directly into `test/asan/TestCases`. If it's POSIX-only, place it under `Posix/` subdirectory.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D42644





More information about the cfe-commits mailing list