[clang] [llvm] [clang] Prevent sandbox violations in `CrossTranslationUnitContext` (PR #175097)

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 9 10:52:44 PST 2026


================
@@ -620,6 +621,8 @@ CrossTranslationUnitContext::ASTLoader::loadFromSource(
   auto Diags = llvm::makeIntrusiveRefCnt<DiagnosticsEngine>(DiagID, *DiagOpts,
                                                             DiagClient);
 
+  // This runs the driver which isn't expected to be free of sandbox violations.
+  auto BypassSandbox = llvm::sys::sandbox::scopedDisable();
----------------
benlangmuir wrote:

The change here LGTM, but do you think this deserves a FIXME? I'm not clear whether this is okay or not long term. From a VFS usage perspective calling back to the driver may or may not be okay if you don't pass in a VFS.  From a caching perspective it would need special handling.


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


More information about the cfe-commits mailing list