[libcxx-commits] [PATCH] D96842: [dfsan] Do not specialize vector<bool> for DFSan

Kostya Serebryany via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 24 15:35:59 PST 2021


kcc added a comment.

ugh.. 
If I were the maintainer of this file, I would run away from this change. 
Not because there is something wrong with it functionality-wise, but because of the ifdefs :( 
We ourselves in the sanitizer land would reject a change with this many ifdefs w/o looking further.

Some options to explore, even though I am not sure any of those options are nice:

- Have an ifdef in one place and function calls in all other places, e.g. instead of #ifdef DATAFLOW_SANITIZER do-foo #endif ... #ifdef DATAFLOW_SANITIZER do-bar #endif

have

  #ifdef DATAFLOW_SANITIZER
    void doo_foo() { stuff(); } 
    void doo_bar() { other_stuff(); }
  #else
    void doo_foo() { }
    void doo_bar() { }   
  #endif
  
   do_foo();
    ...
   do_bar()

- Have a separate specialization for vector<bool> under dfsan, that would use vector<uint8_t> but implement the rest of the vector<bool> interface however ineffectively.

- Give up, and fix issues like this on the user side, by not using vector<bool> directly (for cases when we need taint tracking).

- ???


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96842



More information about the libcxx-commits mailing list