[clang] [MS][clang] Fix crash on deletion of array of pointers (PR #134088)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 3 03:45:22 PDT 2025


================
@@ -2033,6 +2033,9 @@ llvm::Value *MicrosoftCXXABI::EmitVirtualDestructorCall(
     ThisTy = D->getDestroyedType();
   }
 
+  while (const ArrayType *ATy = ThisTy->getAsArrayTypeUnsafe())
----------------
Fznamznon wrote:

Thanks for the catch! Yeah, I knew it drops qualifiers. I kind of didn't expect that something cares about qualifiers that deep in the codegen.
It seems `EmitCXXDestructorCall` cares about address spaces. Usually targets that care about address spaces don't support virtual calls. So I'm not sure how I can break or test this.
But I made it "safe" by using ASTContext since it is anyway easily accessible here.

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


More information about the cfe-commits mailing list