Skip to content
Snippets Groups Projects
  • Alexey Samsonov's avatar
    87d48052
    [ASan] Improve blacklisting of global variables. · 87d48052
    Alexey Samsonov authored
    This commit changes the way we blacklist global variables in ASan.
    Now the global is excluded from instrumentation (either regular
    bounds checking, or initialization-order checking) if:
    
    1) Global is explicitly blacklisted by its mangled name.
    This part is left unchanged.
    
    2) SourceLocation of a global is in blacklisted source file.
    This changes the old behavior, where instead of looking at the
    SourceLocation of a variable we simply considered llvm::Module
    identifier. This was wrong, as identifier may not correspond to
    the file name, and we incorrectly disabled instrumentation
    for globals coming from #include'd files.
    
    3) Global is blacklisted by type.
    Now we build the type of a global variable using Clang machinery
    (QualType::getAsString()), instead of llvm::StructType::getName().
    
    After this commit, the active users of ASan blacklist files
    may have to revisit them (this is a backwards-incompatible change).
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220097 91177308-0d34-0410-b5e6-96231b3b80d8
    87d48052
    History
    [ASan] Improve blacklisting of global variables.
    Alexey Samsonov authored
    This commit changes the way we blacklist global variables in ASan.
    Now the global is excluded from instrumentation (either regular
    bounds checking, or initialization-order checking) if:
    
    1) Global is explicitly blacklisted by its mangled name.
    This part is left unchanged.
    
    2) SourceLocation of a global is in blacklisted source file.
    This changes the old behavior, where instead of looking at the
    SourceLocation of a variable we simply considered llvm::Module
    identifier. This was wrong, as identifier may not correspond to
    the file name, and we incorrectly disabled instrumentation
    for globals coming from #include'd files.
    
    3) Global is blacklisted by type.
    Now we build the type of a global variable using Clang machinery
    (QualType::getAsString()), instead of llvm::StructType::getName().
    
    After this commit, the active users of ASan blacklist files
    may have to revisit them (this is a backwards-incompatible change).
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220097 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.