[clang] [clang][NFC] Don't track OpaqueValueExpr in bad conversion sequence (PR #238243)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 01:28:39 PST 2026


================
@@ -597,7 +597,8 @@ class Sema;
   public:
     void init(FailureKind K, Expr *From, QualType To) {
       init(K, From->getType(), To);
-      FromExpr = From;
+      if (!isa<OpaqueValueExpr>(From))
+        FromExpr = From;
----------------
zyn0217 wrote:

> So the idea is that if this is an OVE we won't track them after the init has occurred, so the UaF problem is mitigated?

Yes, in the function above it sets FromExpr to null and all the clients would check that. We wouldn't have UAF nor leaking with this.

https://github.com/llvm/llvm-project/pull/238243


More information about the cfe-commits mailing list