[clang] Fix analyzer crash on 'StructuralValue' (PR #79764)
    Balazs Benics via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Jan 29 05:08:13 PST 2024
    
    
  
================
@@ -40,8 +40,12 @@ static const Expr *ignoreTransparentExprs(const Expr *E) {
 
   switch (E->getStmtClass()) {
   case Stmt::OpaqueValueExprClass:
-    E = cast<OpaqueValueExpr>(E)->getSourceExpr();
-    break;
+    if (const clang::Expr *SE = cast<OpaqueValueExpr>(E)->getSourceExpr()) {
+      E = SE;
+      break;
+    } else {
+      return E;
+    }
----------------
steakhal wrote:
Makes sense. Consider this resolved.
https://github.com/llvm/llvm-project/pull/79764
    
    
More information about the cfe-commits
mailing list