================
@@ -661,8 +711,23 @@ class TransferFunctions : public
StmtVisitor<TransferFunctions> {
} // namespace
-void TransferFunctions::reportUse(const Expr *ex, const VarDecl *vd) {
+void TransferFunctions::VisitArraySubscriptExpr(ArraySubscriptExpr *ASE) {
+ // Handle array subscript expressions like arr[i]
+ // Check if the base array variable is uninitialized
+ FindVarResult Var = findVar(ASE->getBase());
+
+ if (const VarDecl *VD = Var.getDecl()) {
+ if (VD->getType()->isArrayType())
+ reportUse(ASE, VD);
+ }
+
+ // Also visit index expression
+ Visit(ASE->getIdx());
+}
+
+void TransferFunctions::reportUse(const Expr *ex, const VarDecl *vd) {
Value v = vals[vd];
+
----------------
zwuis wrote:
Unrelated changes?
https://github.com/llvm/llvm-project/pull/166991
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits