New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion failure in clang::ento::MemRegionManager::getElementRegion() #33657
Comments
assigned to @alexshap |
This started happening after r310887. |
Tracking this internally as rdar://problem/34062527 |
a bit smaller reduced test case: m.cpp: bool f(long x, char *p) { clang --analyze -c m.cpp i have an idea what's going on there, but need a bit more time to double check |
if i am not mistaken we hit the following FIXME 359 case nonloc::LocAsIntegerKind: { |
Resolved by https://reviews.llvm.org/rL311935 and https://reviews.llvm.org/rL311947 . |
Thank you! It looks like the fix has introduced another failure though (or didn't fix all cases, since the stack trace looks suspiciously similar). I'm currently reducing the test case and will file a separate issue. |
I've reopened this bug. |
oh, i see, i didn't read your comment, |
The other bug is filed as llvm/llvm-bugzilla-archive#34374 . Could you also take a look at llvm/llvm-bugzilla-archive#34373 ? |
Extended Description
$ cat /tmp/getElementRegion-crash.cc
struct {
int n;
bool f(unsigned &p1) { p1 = (long)n - 1; }
} b;
unsigned a;
int c;
void g() { b.f(a) && a == c; }
$ clang_tidy -checks=-,clang-analyzer-* /tmp/getElementRegion-crash.cc -- -std=c++11
assert.h assertion failed at llvm/tools/clang/include/clang/AST/Type.h:628 in const clang::ExtQualsTypeCommonBase *clang::QualType::getCommonPtr() const: !isNull() && "Cannot retrieve a NULL type pointer"
@ 0x53f0f5a __assert_fail
@ 0x5e9065 clang::QualType::getCommonPtr()
@ 0x5ddbe9 clang::QualType::getCanonicalType()
@ 0x1b4f5cc clang::ASTContext::getCanonicalType()
@ 0x2c50612 clang::ento::MemRegionManager::getElementRegion()
@ 0x2d07f58 (anonymous namespace)::SimpleSValBuilder::evalBinOpLN()
@ 0x2bbbace clang::ento::SValBuilder::evalBinOp()
@ 0x2d09ab4 (anonymous namespace)::SimpleSValBuilder::simplifySVal()::Simplifier::VisitSymIntExpr()
@ 0x2d09692 clang::ento::SymExprVisitor<>::Visit()
@ 0x2d093ea (anonymous namespace)::SimpleSValBuilder::simplifySVal()::Simplifier::VisitNonLocSymbolVal()
@ 0x2d08f6b clang::ento::SValVisitor<>::Visit()
@ 0x2d0822f (anonymous namespace)::SimpleSValBuilder::simplifySVal()
@ 0x2d056cc (anonymous namespace)::SimpleSValBuilder::evalBinOpNN()
@ 0x2bbbd92 clang::ento::SValBuilder::evalBinOp()
@ 0x2cab136 clang::ento::ExprEngine::evalBinOp()
@ 0x2cd8320 clang::ento::ExprEngine::VisitBinaryOperator()
@ 0x2ca0a91 clang::ento::ExprEngine::Visit()
@ 0x2c9dea4 clang::ento::ExprEngine::ProcessStmt()
@ 0x2c9db6a clang::ento::ExprEngine::processCFGElement()
@ 0x2ccb526 clang::ento::CoreEngine::HandlePostStmt()
@ 0x2ccae23 clang::ento::CoreEngine::dispatchWorkItem()
@ 0x2cca9b8 clang::ento::CoreEngine::ExecuteWorkList()
@ 0x21227d5 clang::ento::ExprEngine::ExecuteWorkList()
@ 0x20cb182 (anonymous namespace)::AnalysisConsumer::ActionExprEngine()
@ 0x20caf41 (anonymous namespace)::AnalysisConsumer::RunPathSensitiveChecks()
@ 0x20cac05 (anonymous namespace)::AnalysisConsumer::HandleCode()
@ 0x20be323 (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph()
@ 0x20bc5a7 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit()
@ 0x29d335e clang::MultiplexConsumer::HandleTranslationUnit()
The text was updated successfully, but these errors were encountered: