Skip to content
Snippets Groups Projects
  • Alexey Samsonov's avatar
    6cb698a5
    [UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent. · 6cb698a5
    Alexey Samsonov authored
    -fsanitize=shift is now a group that includes both these checks, so
    exisiting users should not be affected.
    
    This change introduces two new UBSan kinds that sanitize only left-hand
    side and right-hand side of shift operation. In practice, invalid
    exponent value (negative or too large) tends to cause more portability
    problems, including inconsistencies between different compilers, crashes
    and inadequeate results on non-x86 architectures etc. That is,
    -fsanitize=shift-exponent failures should generally be addressed first.
    
    As a bonus, this change simplifies CodeGen implementation for emitting left
    shift (separate checks for base and exponent are now merged by the
    existing generic logic in EmitCheck()), and LLVM IR for these checks
    (the number of basic blocks is reduced).
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231150 91177308-0d34-0410-b5e6-96231b3b80d8
    6cb698a5
    History
    [UBSan] Split -fsanitize=shift into -fsanitize=shift-base and -fsanitize=shift-exponent.
    Alexey Samsonov authored
    -fsanitize=shift is now a group that includes both these checks, so
    exisiting users should not be affected.
    
    This change introduces two new UBSan kinds that sanitize only left-hand
    side and right-hand side of shift operation. In practice, invalid
    exponent value (negative or too large) tends to cause more portability
    problems, including inconsistencies between different compilers, crashes
    and inadequeate results on non-x86 architectures etc. That is,
    -fsanitize=shift-exponent failures should generally be addressed first.
    
    As a bonus, this change simplifies CodeGen implementation for emitting left
    shift (separate checks for base and exponent are now merged by the
    existing generic logic in EmitCheck()), and LLVM IR for these checks
    (the number of basic blocks is reduced).
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231150 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.