Skip to content

Commit 01b60df

Browse files
authored
[CIR][NFC] Fix memory corruption in type converter (#160211)
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.
1 parent b3d0865 commit 01b60df

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,9 +2381,6 @@ static void prepareTypeConverter(mlir::LLVMTypeConverter &converter,
23812381
}
23822382
break;
23832383
}
2384-
converter.addConversion([&](cir::VoidType type) -> mlir::Type {
2385-
return mlir::LLVM::LLVMVoidType::get(type.getContext());
2386-
});
23872384

23882385
// Record has a name: lower as an identified record.
23892386
mlir::LLVM::LLVMStructType llvmStruct;

0 commit comments

Comments
 (0)