Revert "[clang][analyzer] Fix a nullptr dereference when -ftime-trace is used" (#139936)

Reverts llvm/llvm-project#139820

Reverting due to buildbot failures in asan
This commit is contained in:
Fangyi Zhou
2025-05-14 18:45:05 +01:00
committed by GitHub
parent 47144a0dc1
commit baf2cfa299
2 changed files with 1 additions and 9 deletions

View File

@@ -103,10 +103,7 @@ public:
const Stmt *getStmt() const {
switch (Elem->getKind()) {
case CFGElement::Initializer:
if (const auto *Init = Elem->castAs<CFGInitializer>().getInitializer()) {
return Init->getInit();
}
return nullptr;
return Elem->castAs<CFGInitializer>().getInitializer()->getInit();
case CFGElement::ScopeBegin:
return Elem->castAs<CFGScopeBegin>().getTriggerStmt();
case CFGElement::ScopeEnd:

View File

@@ -1,5 +0,0 @@
// RUN: %clang_analyze_cc1 -analyzer-checker=core,apiModeling %s -ftime-trace=%t.raw.json -verify
// expected-no-diagnostics
// GitHub issue 139779
struct {} a; // no-crash