[PATCH] D53528: [sanitizer] Avoid calling a nullptr in MonotonicNanoTime if interceptors are not yet initialized

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 23 08:49:26 PDT 2018


cryptoad added a comment.

In https://reviews.llvm.org/D53528#1272587, @kubamracek wrote:

> Yes, but it would need to be on the `if (CanUseVDSO)` line otherwise we still get a crash. I'll update the patch.


My thought is that if `extern "C" real_clock_gettime` doesn't exist, it means that the function `clock_gettime` is not intercepted, hence we don't need to check for `REAL(clock_gettime)` eg `__interception::real_clock_gettime` to be not null.
Basically that would save us a memory read in case of non-interception. But I might be wrong.


https://reviews.llvm.org/D53528





More information about the llvm-commits mailing list