<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 - A null pointer dereference error in GIMatchTree::writeDOTGraphEdges"
href="https://bugs.llvm.org/show_bug.cgi?id=48117">48117</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>A null pointer dereference error in GIMatchTree::writeDOTGraphEdges
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</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>TableGen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alansnape3058@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>According to the bug reports of my clang static analyzer fork, in class
`llvm::GIMatchTree`, if `Partitioner` is not set or set to nullptr, when
calling function `GIMatchTree::writeDOTGraph`, a null pointer dereference will
occur in function `GIMatchTree::writeDOTGraphEdges`.
1. call function GIMatchTree::writeDOTGraph:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:24
24 void GIMatchTree::writeDOTGraph(raw_ostream &OS) const {
2. call function GIMatchTree::writeDOTGraphNode:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:26
26 writeDOTGraphNode(OS);
3. assume `Partitioner` is null, take the false branch:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:32
32 if (Partitioner) {
4. assume `Partitioner` is null, take the false branch:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:48
48 if (!Partitioner && !IsFullyTraversed)
5. assume `Partitioner` is null, take the false branch:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:50
50 if (!Partitioner && !IsFullyTested) {
6. assume `Partitioner` is null, take the false branch:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:63
63 if (!Partitioner &&
7. call function GIMatchTree::writeDOTGraphEdges:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:69
69 writeDOTGraphEdges(OS);
8. dereference null smart pointer `Partitioner`:
llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp:76
76 Partitioner->emitPartitionName(OS, Child.index());
Although the problem will not be triggered with the path presented, the problem
still worth noting.
See the attached HTML report for more details.</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>