[llvm-bugs] [Bug 39971] New: Assertion failure in in PaddingChecker::visitRecord

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Dec 12 02:16:43 PST 2018


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

            Bug ID: 39971
           Summary: Assertion failure in in PaddingChecker::visitRecord
           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

$ cat test-PaddingChecker__visitRecord.cc
namespace a {
template <typename b> struct atomic { b c; };
}
typedef long d;
struct e {
  alignas(64) a::atomic<d> f;
  d g;
  alignas(64) a::atomic<d> h;
  char i[64 - sizeof(d)];
};

$ ./clang-tidy -checks="clang-analyzer*" test-PaddingChecker__visitRecord.cc --
-std=c++11
F1212 11:16:58.700911   40300 logging.cc:82] assert.h assertion failed at
third_party/llvm/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp:108
in void (anonymous namespace)::PaddingChecker::visitRecord(const
clang::RecordDecl *, uint64_t) const: !DiffPad.isNegative() && "DiffPad should
not be negative"
*** Check failure stack trace: ***
    @     0x5630d023a4f9  (anonymous namespace)::PaddingChecker::visitRecord()
    @     0x5630d022a00d  clang::RecursiveASTVisitor<>::TraverseCXXRecordDecl()
    @     0x5630d0225c8b  clang::RecursiveASTVisitor<>::TraverseDecl()
    @     0x5630d022c1d9 
clang::RecursiveASTVisitor<>::TraverseTranslationUnitDecl()
    @     0x5630d0225f4c  clang::RecursiveASTVisitor<>::TraverseDecl()
    @     0x5630d02243f7  clang::ento::check::ASTDecl<>::_checkDecl<>()
    @     0x5630d04812bf  clang::ento::CheckerManager::runCheckersOnASTDecl()
    @     0x5630d019f6d9  (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
    @     0x5630d071320c  clang::MultiplexConsumer::HandleTranslationUnit()
    @     0x5630d08ce414  clang::ParseAST()
    @     0x5630d070cd63  clang::FrontendAction::Execute()
    @     0x5630d05c17e1  clang::CompilerInstance::ExecuteAction()
    @     0x5630d051a7d1 
clang::tooling::FrontendActionFactory::runInvocation()
    @     0x5630cfe1cc27 
clang::tidy::runClangTidy()::ActionFactory::runInvocation()
    @     0x5630d051a53a  clang::tooling::ToolInvocation::runInvocation()
    @     0x5630d0519f26  clang::tooling::ToolInvocation::run()
    @     0x5630d051c625  clang::tooling::ClangTool::run()
    @     0x5630cfe1896f  clang::tidy::runClangTidy()

-- 
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/20181212/50e1b668/attachment.html>


More information about the llvm-bugs mailing list