Skip to content

Conversation

vitalybuka
Copy link
Collaborator

@vitalybuka vitalybuka commented Oct 6, 2025

I don't think we need them after AST is destroyed.
If I am wrong we should see crashes immediately, as pointers de-referenced unchecked.

Created using spr 1.3.6
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Oct 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 6, 2025

@llvm/pr-subscribers-clang

Author: Vitaly Buka (vitalybuka)

Changes

I don't thin we need them after AST is destroyed.
If I am wrong we should see crashes immediately, as pointers dereferenced unchecked.


Full diff: https://github.com/llvm/llvm-project/pull/162119.diff

1 Files Affected:

  • (modified) clang/lib/AST/ASTContext.cpp (+3)
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 056bfe36b2a0a..6ac0767c80067 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -976,6 +976,9 @@ void ASTContext::cleanup() {
   for (const auto &Value : ModuleInitializers)
     Value.second->~PerModuleInitializers();
   ModuleInitializers.clear();
+
+  XRayFilter.reset();
+  NoSanitizeL.reset();
 }
 
 ASTContext::~ASTContext() { cleanup(); }

@vitalybuka vitalybuka requested review from fmayer and thurstond October 6, 2025 17:00
Created using spr 1.3.6
@vitalybuka vitalybuka changed the base branch from users/vitalybuka/spr/main.nfcast-clean-up-xrayfilter-and-nosanitizel-before-backend to main October 6, 2025 17:12
@vitalybuka vitalybuka enabled auto-merge (squash) October 6, 2025 17:12
@vitalybuka vitalybuka merged commit 68a7196 into main Oct 6, 2025
11 of 12 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfcast-clean-up-xrayfilter-and-nosanitizel-before-backend branch October 6, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants