-
Notifications
You must be signed in to change notification settings - Fork 168
Open
Description
Per the documentation:
The
MIR_allocinstance passed toMIR_init2must have a lifetime greater or equal to the resultingMIR_context, i.e. live at least as long as the subsequent call toMIR_finish. TheMIR_allocinstance being destroyed or going out of scope beforehand may result in undefined behavior.
This fails to mention the usecase of MIR_change_module_ctx, which doesn't seem to reallocate data on the new context's allocator. This makes it impossible to use e.g. an arena allocator on a temporary compilation context, because the migrated module will now outlive the arena allocator, despite the above quote.
If asked, I could contribute a PR for this.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels