================ @@ -14690,6 +14690,13 @@ void Sema::FinalizeDeclaration(Decl *ThisDecl) { } } + // The result of __builtin_counted_by_ref cannot be assigned to a variable. + // It allows leaking and modification of bounds safety information. + if (IsBuiltinCountedByRef(VD->getInit())) + Diag(VD->getInit()->getExprLoc(), + diag::err_builtin_counted_by_ref_cannot_leak_reference) + << VD->getInit()->getSourceRange(); ---------------- Sirraide wrote:
I was going to comment on that too, but ended up forgetting about it; it’s used in like 3–4 places, so I personally would prefer making this a helper function. https://github.com/llvm/llvm-project/pull/116719 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits