[llvm-bugs] [Bug 46253] New: malloc analyzer check crashes

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 9 08:04:23 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46253

            Bug ID: 46253
           Summary: malloc analyzer check crashes
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: hokein at google.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

./clang-tidy -checks="-*,clang-analyzer*" /tmp/crash.cpp


crash.cpp:

class a {
  void realloc(int, bool = false) { realloc(1); }
};


assert.h assertion failed at
llvm-project/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:427 in
clang::ento::SVal
clang::ento::SValBuilder::evalBinOp(clang::ento::ProgramStateRef,
BinaryOperator::Opcode, clang::ento::SVal, clang::ento::SVal, clang::QualType):
op == BO_Add
*** Check failure stack trace: ***
    @     0x564aecc437c6  __assert_fail
    @     0x564aeb336cbf  clang::ento::SValBuilder::evalBinOp()
    @     0x564aeb336efc  clang::ento::SValBuilder::evalEQ()
    @     0x564aeb13e777  (anonymous namespace)::MallocChecker::ReallocMemAux()
    @     0x564aeb135ba2  (anonymous namespace)::MallocChecker::checkRealloc()
    @     0x564aeb1454bd  clang::ento::check::PostCall::_checkCall<>()
    @     0x564aeb29b3f2 
clang::ento::CheckerManager::runCheckersForCallEvent()
    @     0x564aeb2e067e  clang::ento::ExprEngine::evalCall()
    @     0x564aeb2e0333  clang::ento::ExprEngine::VisitCallExpr()
    @     0x564aeb2bfe8d  clang::ento::ExprEngine::Visit()
    @     0x564aeb2bb96c  clang::ento::ExprEngine::ProcessStmt()
    @     0x564aeb2bb648  clang::ento::ExprEngine::processCFGElement()

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200609/3f534742/attachment-0001.html>


More information about the llvm-bugs mailing list