llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: mikit (m1kit)

<details>
<summary>Changes</summary>

It is undefined behavior to use `delete` expression on something which was not 
created with corresponding `new` expression. Switching to explicit global 
`operator delete()` call to match with `operator new()` call at 
`CGFunctionInfo::create()`.

This issue is raised by Chromium ClusterFuzz, with ASan enabled. 
https://crbug.com/410141973

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


1 Files Affected:

- (modified) clang/lib/CodeGen/CodeGenTypes.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp 
b/clang/lib/CodeGen/CodeGenTypes.cpp
index b94c11802a268..dec3b087b107f 100644
--- a/clang/lib/CodeGen/CodeGenTypes.cpp
+++ b/clang/lib/CodeGen/CodeGenTypes.cpp
@@ -41,7 +41,7 @@ CodeGenTypes::CodeGenTypes(CodeGenModule &cgm)
 CodeGenTypes::~CodeGenTypes() {
   for (llvm::FoldingSet<CGFunctionInfo>::iterator
        I = FunctionInfos.begin(), E = FunctionInfos.end(); I != E; )
-    delete &*I++;
+    operator delete(&*I++);
 }
 
 CGCXXABI &CodeGenTypes::getCXXABI() const { return getCGM().getCXXABI(); }

``````````

</details>


https://github.com/llvm/llvm-project/pull/135787
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to