We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87b3299 commit 45956ecCopy full SHA for 45956ec
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
@@ -101,6 +101,11 @@ class SymbolConjured : public SymbolData {
101
102
// It might return null.
103
const Stmt *getStmt() const {
104
+ if (const auto *Parent = Elem.getParent()) {
105
+ // Sometimes the CFG element is invalid, avoid dereferencing it.
106
+ if (Elem.getIndexInBlock() >= Parent->size())
107
+ return nullptr;
108
+ }
109
switch (Elem->getKind()) {
110
case CFGElement::Initializer:
111
if (const auto *Init = Elem->castAs<CFGInitializer>().getInitializer()) {
0 commit comments