<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Assertion failure in CStringChecker::CheckLocation"
href="https://bugs.llvm.org/show_bug.cgi?id=34779">34779</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failure in CStringChecker::CheckLocation
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>ganna@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alexfh@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dcoughlin@apple.com, kremenek@apple.com, llvm-bugs@lists.llvm.org, noqnoqneo@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>$ cat test-__CStringChecker__evalStrcpyCommon.cc
void strcpy(unsigned char *, unsigned char *);
unsigned char a, b;
void c() { strcpy(&a, &b); }
$ clang-tidy -checks=-*,clang-analyzer-unix.cstring*
test-__CStringChecker__evalStrcpyCommon.cc -- -std=c++11
assertion failed at
llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp:293 in
clang::ento::ProgramStateRef (anonymous
namespace)::CStringChecker::CheckLocation(clang::ento::CheckerContext &,
clang::ento::ProgramStateRef, const clang::Expr *, clang::ento::SVal, const
char *) const: ER->getValueType() == C.getASTContext().CharTy && "CheckLocation
should only be called with char* ElementRegions"
*** Check failure stack trace: ***
@ 0x52c61ca __assert_fail
@ 0x1b3b2cb (anonymous
namespace)::CStringChecker::CheckLocation()
@ 0x1b3e278 (anonymous
namespace)::CStringChecker::evalStrcpyCommon()
@ 0x1b37571 (anonymous namespace)::CStringChecker::evalStrcpy()
@ 0x1b36174 (anonymous namespace)::CStringChecker::evalCall()
@ 0x1b34f30 clang::ento::eval::Call::_evalCall<>()
@ 0x1c554b2 clang::ento::CheckerFn<>::operator()()
@ 0x1c5262e clang::ento::CheckerManager::runCheckersForEvalCall()
@ 0x1cb62f9 clang::ento::ExprEngine::evalCall()
@ 0x1cb61bc clang::ento::ExprEngine::VisitCallExpr()
@ 0x1c6ef27 clang::ento::ExprEngine::Visit()
@ 0x1c6bf01 clang::ento::ExprEngine::ProcessStmt()
@ 0x1c6bbba clang::ento::ExprEngine::processCFGElement()
@ 0x1c9a206 clang::ento::CoreEngine::HandlePostStmt()
@ 0x1c99b06 clang::ento::CoreEngine::dispatchWorkItem()
@ 0x1c99668 clang::ento::CoreEngine::ExecuteWorkList()
@ 0xf8c365 clang::ento::ExprEngine::ExecuteWorkList()
@ 0xf33992 (anonymous
namespace)::AnalysisConsumer::ActionExprEngine()
@ 0xf33751 (anonymous
namespace)::AnalysisConsumer::RunPathSensitiveChecks()
@ 0xf33415 (anonymous namespace)::AnalysisConsumer::HandleCode()
@ 0xf26ab3 (anonymous
namespace)::AnalysisConsumer::HandleDeclsCallGraph()
@ 0xf24d37 (anonymous
namespace)::AnalysisConsumer::HandleTranslationUnit()
@ 0x135bf7e clang::MultiplexConsumer::HandleTranslationUnit()
@ 0x1db73d6 clang::ParseAST()
@ 0x134982a clang::ASTFrontendAction::ExecuteAction()
@ 0x13492c0 clang::FrontendAction::Execute()
@ 0x115f4e2 clang::CompilerInstance::ExecuteAction()
@ 0x1028652
clang::tooling::FrontendActionFactory::runInvocation()
@ 0x10284f3 clang::tooling::ToolInvocation::runInvocation()</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>