[PATCH] [Sanitizers] Order initialization of coverage and guard arrays

Viktor Kutuzov vkutuzov at accesssoftek.com
Wed Jan 28 08:15:06 PST 2015


OK, it makes sense, thanks. However, while it works for Asan's ##__asan_init()t## called from the code injected by the instrumentation part, it doesn't work for UBsan where, in omission of SANITIZER_CAN_USE_PREINIT_ARRAY, ##__ubsan::InitIfNecessary()## is called from a regular constructor which has a lower priority than ##__sanitizer_cov_module_init##. Maybe we should introduce instrumentation for UBsan or just replace the ##ubsan_initializer## declaration:

  class UbsanInitializer {
   public:
    UbsanInitializer() {
      InitIfNecessary();
    }
  };
  static UbsanInitializer ubsan_initializer;

with something like:

  __attribute__((constructor(1)))
  void __init_ubsan() {
    InitIfNecessary();
  }


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6892

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list