llvm-project/lldb/unittests
Vedant Kumar 7b90cdedd1 [lldb/DataExtractor] Fix UB shift in GetMaxS64Bitfield
DataExtractor::GetMaxS64Bitfield performs a shift with UB in order to
construct a bitmask when bitfield_bit_size is 64. The current
implementation actually does “work” in this case, because the assumption
that the shift result is 0 holds, and 0 minus 1 gives the all-ones value
(the correct mask). However, the more readable/maintainable approach
might be to use an off-the-shelf UB-free helper.

Fixes a UBSan issue:

  "col" : 37,
  "description" : "invalid-shift-exponent",
  "filename" : "/Users/vsk/src/llvm-project-master/lldb/source/Utility/DataExtractor.cpp",
  "instrumentation_class" : "UndefinedBehaviorSanitizer",
  "line" : 615,
  "memory_address" : 0,
  "summary" : "Shift exponent 64 is too large for 64-bit type 'uint64_t' (aka 'unsigned long long')",

rdar://59117758

Differential Revision: https://reviews.llvm.org/D73913
2020-02-03 15:57:32 -08:00
..
Breakpoint [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Core [lldb][NFCI] Remove unused LanguageType parameters 2020-01-30 21:57:23 -08:00
DataFormatter [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Disassembler [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Editline [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Expression [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
Host Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Interpreter Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Language Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ObjectFile [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Platform [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Process [ADT] Make StringRef's std::string conversion operator explicit 2020-01-28 23:47:07 +01:00
ScriptInterpreter [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Signals [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
SymbolFile [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
Target [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
TestingSupport [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
UnwindAssembly [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Utility [lldb/DataExtractor] Fix UB shift in GetMaxS64Bitfield 2020-02-03 15:57:32 -08:00
debugserver [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
tools [ADT] Make StringRef's std::string conversion operator explicit 2020-01-28 23:47:07 +01:00
CMakeLists.txt [FormatManager] Add a unittest for GetCandidateLanguages() 2019-12-10 13:42:59 -08:00
gtest_common.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00