[llvm-bugs] [Bug 41239] New: Assertion failure at clang/lib/Basic/SourceManager.cpp:1370 in SrcMgr::CharacteristicKind clang::SourceManager::getFileCharacteristic(clang::SourceLocation) const: Loc.isValid() && "Can't get file characteristic of invalid loc!"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 26 08:10:42 PDT 2019


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

            Bug ID: 41239
           Summary: Assertion failure at
                    clang/lib/Basic/SourceManager.cpp:1370 in
                    SrcMgr::CharacteristicKind
                    clang::SourceManager::getFileCharacteristic(clang::Sou
                    rceLocation) const: Loc.isValid() && "Can't get file
                    characteristic of invalid loc!"
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: noqnoqneo at gmail.com
          Reporter: alexfh at google.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org

$ cat /tmp/q.c
struct s {
  char *ss;
};
void g(struct s *d) {
  if (d->ss) {
  }
  f(d);
  bcmp(d->ss, "", 4);
}
int f(struct s *str) {}
$ clang-tidy -checks=-*,clang-analyzer* /tmp/q.c --
assert.h assertion failed at clang/lib/Basic/SourceManager.cpp:1370 in
SrcMgr::CharacteristicKind
clang::SourceManager::getFileCharacteristic(clang::SourceLocation) const:
Loc.isValid() && "Can't get file characteristic of invalid loc!"
    @     0x55f75bd2e926  __assert_fail
    @     0x55f75b94cb88  clang::SourceManager::getFileCharacteristic()
    @     0x55f75a37c677  (anonymous
namespace)::NoStoreFuncVisitor::VisitNode()
    @     0x55f75a35f388  generateVisitorsDiagnostics()
    @     0x55f75a35a855  clang::ento::GRBugReporter::generatePathDiagnostics()
    @     0x55f75a35c8eb 
clang::ento::BugReporter::generateDiagnosticForConsumerMap()
    @     0x55f75a3570fb  clang::ento::BugReporter::FlushReport()
    @     0x55f75a35639b  clang::ento::BugReporter::FlushReports()
    @     0x55f75a0f6c30  (anonymous namespace)::AnalysisConsumer::HandleCode()
    @     0x55f75a0e0673  (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
    @     0x55f75a716e0c  clang::MultiplexConsumer::HandleTranslationUnit()
    @     0x55f75a886dd4  clang::ParseAST()
    @     0x55f75a6f7593  clang::FrontendAction::Execute()
    @     0x55f75a6905d1  clang::CompilerInstance::ExecuteAction()
    @     0x55f75a5fba01 
clang::tooling::FrontendActionFactory::runInvocation()
    @     0x55f759d2f817 
clang::tidy::runClangTidy()::ActionFactory::runInvocation()
    @     0x55f75a5fb76a  clang::tooling::ToolInvocation::runInvocation()
    @     0x55f75a5fb0e6  clang::tooling::ToolInvocation::run()
    @     0x55f75a5fd9d2  clang::tooling::ClangTool::run()
    @     0x55f759d2a9b1  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/20190326/5d3da853/attachment.html>


More information about the llvm-bugs mailing list