diff options
author | vabridgers <58314289+vabridgers@users.noreply.github.com> | 2023-10-02 09:54:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 09:54:22 -0500 |
commit | dd01633c8160e54cc1bc379498cbade646375813 (patch) | |
tree | 37b12e9613f1139297b9cc64ffc8abaac0873daa /llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | |
parent | 263a00fa910bd9d19c8590ad9f7ae1bdd9d76c02 (diff) | |
download | llvm-dd01633c8160e54cc1bc379498cbade646375813.zip llvm-dd01633c8160e54cc1bc379498cbade646375813.tar.gz llvm-dd01633c8160e54cc1bc379498cbade646375813.tar.bz2 |
[analyzer] Fix crash in BasicValueFactory.cpp with __int128_t integers (#67212)
This change avoids a crash in BasicValueFactory by checking the bit
width of an APSInt to avoid calling getZExtValue if greater than
64-bits. This was caught by our internal, randomized test generator.
Clang invocation
clang -cc1 -analyzer-checker=optin.portability.UnixAPI case.c
<src-root>/llvm/include/llvm/ADT/APInt.h:1488:
uint64_t llvm::APInt::getZExtValue() const: Assertion `getActiveBits()
<= 64
&& "Too many bits for uint64_t"' failed.
...
#9 <address> llvm::APInt::getZExtValue() const
<src-root>/llvm/include/llvm/ADT/APInt.h:1488:5
clang::BinaryOperatorKind, llvm::APSInt const&, llvm::APSInt const&)
<src-root>/clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp:307:37
llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>,
clang::BinaryOperatorKind, clang::ento::NonLoc, clang::ento::NonLoc,
clang::QualType)
<src-root>/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:531:31
llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>,
clang::BinaryOperatorKind, clang::ento::SVal, clang::ento::SVal,
clang::QualType)
<src-root>/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:532:26
...
Diffstat (limited to 'llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions