[clang] [clang-repl] Keep the first llvm::Module empty to avoid invalid memory access. (PR #89031)
Jonas Hahnfeld via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 19 06:51:42 PDT 2024
================
@@ -224,11 +228,8 @@ IncrementalParser::IncrementalParser(Interpreter &Interp,
return; // PTU.takeError();
}
- if (CodeGenerator *CG = getCodeGen()) {
- std::unique_ptr<llvm::Module> M(CG->ReleaseModule());
- CG->StartModule("incr_module_" + std::to_string(PTUs.size()),
- M->getContext());
- PTU->TheModule = std::move(M);
+ if (getCodeGen()) {
+ PTU->TheModule = std::move(GenModule());
----------------
hahnjo wrote:
Just to confirm my understanding of the change: this is an independent deduplication cleanup, right?
https://github.com/llvm/llvm-project/pull/89031
More information about the cfe-commits
mailing list