diff options
author | Maksim Levental <maksim.levental@gmail.com> | 2025-09-15 00:45:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-15 06:45:30 +0200 |
commit | 6a4f66476ff59a32898891345bc07547e71028ec (patch) | |
tree | e9fd9bf7d9ab756b032949fe0f4515d367aa1fd5 /clang/lib/AST/ByteCode/Compiler.cpp | |
parent | 65ad21d730d25789454d18e811f8ff5db79cb5d4 (diff) | |
download | llvm-6a4f66476ff59a32898891345bc07547e71028ec.zip llvm-6a4f66476ff59a32898891345bc07547e71028ec.tar.gz llvm-6a4f66476ff59a32898891345bc07547e71028ec.tar.bz2 |
[MLIR][Python] restore `liveModuleMap` (#158506)
There are cases where the same module can have multiple references (via
`PyModule::forModule` via `PyModule::createFromCapsule`) and thus when
`PyModule`s get gc'd `mlirModuleDestroy` can get called multiple times
for the same actual underlying `mlir::Module` (i.e., double free). So we
do actually need a "liveness map" for modules.
Note, if `type_caster<MlirModule>::from_cpp` weren't a thing we could guarantree
this never happened except explicitly when users called `PyModule::createFromCapsule`.
Diffstat (limited to 'clang/lib/AST/ByteCode/Compiler.cpp')
0 files changed, 0 insertions, 0 deletions