Skip to content

Memory leak in LLVM::Module #13952

Open
Open
@HertzDevil

Description

@HertzDevil

llvm-c/Core.h says the following:

/**
 * Create a new, empty module in a specific context.
 *
 * Every invocation should be paired with LLVMDisposeModule() or memory
 * will be leaked.
 */
LLVMModuleRef LLVMModuleCreateWithNameInContext(const char *ModuleID,
                                                LLVMContextRef C);

However, there is neither LLVM::Module#finalize nor a binding for LLVMDisposeModule, so there will be a memory leak every time LLVM::Context#new_module is called. This could pose a problem in some use cases (maybe the playground).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions