From 0375f89971a5a9b2f3598f99a1a93698dfc7b08e Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Mon, 22 Sep 2025 15:32:52 -0700 Subject: [PATCH] [CIR][NFC] Fix memory corruption in type converter This fixes a problem where a rogue call to converter.addConversion inside of a type conversion lambda was causing memory corruption that (luckily!) triggered a test failure on some build platforms. Near as I can tell, the unwanted addConversion call was the result of a bad rebase (by me). The code shouldn't have ever been there. Because the failure depends on the build environment, I can't find a reliable way to test this change. --- clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp index 1865698838134..1596ccb6a2617 100644 --- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp +++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp @@ -2381,9 +2381,6 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter, } break; } - converter.addConversion([&](cir::VoidType type) -> mlir::Type { - return mlir::LLVM::LLVMVoidType::get(type.getContext()); - }); // Record has a name: lower as an identified record. mlir::LLVM::LLVMStructType llvmStruct;