<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - Crash for alpha.core.CastToStruct"
href="https://llvm.org/bugs/show_bug.cgi?id=31173">31173</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash for alpha.core.CastToStruct
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>kremenek@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>abramo.bagnara@bugseng.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The checker crashes badly:
$ cat q.c
struct s {
int v;
} x;
int main() {
struct t* p = (struct t*) &x;
}
$ clang-4.0 -cc1 -analyze -analyzer-checker=alpha.core.CastToStruct q.c
0 libLLVM-4.0.so.1 0x00007fb1da6941d8
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 56
1 libLLVM-4.0.so.1 0x00007fb1da69234e llvm::sys::RunSignalHandlers() + 62
2 libLLVM-4.0.so.1 0x00007fb1da69249c
3 libpthread.so.0 0x00007fb1dce0b3e0
4 clang-4.0 0x00000000017e5d0e
clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const + 1214
5 clang-4.0 0x00000000016a96aa
clang::ASTContext::getTypeInfoImpl(clang::Type const*) const + 586
6 clang-4.0 0x00000000016a096c
clang::ASTContext::getTypeInfo(clang::Type const*) const + 172
7 clang-4.0 0x000000000075ab3e
8 clang-4.0 0x000000000075d496
9 clang-4.0 0x00000000014e9eb7
10 clang-4.0 0x00000000014ea6d3
11 clang-4.0 0x00000000014e726c
12 clang-4.0 0x00000000014e8d10
13 clang-4.0 0x00000000014ea6d3
14 clang-4.0 0x00000000014ec147
15 clang-4.0 0x00000000014e720b
16 clang-4.0 0x00000000014ec253
17 clang-4.0 0x0000000001564775
clang::ento::CheckerManager::runCheckersOnASTBody(clang::Decl const*,
clang::ento::AnalysisManager&, clang::ento::BugReporter&) + 101
18 clang-4.0 0x0000000000d1268e
19 clang-4.0 0x0000000000d182d3
20 clang-4.0 0x0000000000d13402
21 clang-4.0 0x0000000000d1a8c7
22 clang-4.0 0x0000000000d203c8 clang::ParseAST(clang::Sema&, bool,
bool) + 792
23 clang-4.0 0x0000000000ae6d9e clang::FrontendAction::Execute() + 286
24 clang-4.0 0x0000000000ab8076
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 310
25 clang-4.0 0x0000000000b63cc2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2514
26 clang-4.0 0x00000000007a23a8 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 2392
27 clang-4.0 0x0000000000793ebe main + 7182
28 libc.so.6 0x00007fb1d9135830 __libc_start_main + 240
29 clang-4.0 0x00000000007a0749 _start + 41
Stack dump:
0. Program arguments: clang-4.0 -cc1 -analyze
-analyzer-checker=alpha.core.CastToStruct q.c
1. <eof> parser at end of file</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>