[PATCH] D71959: [PassManagerBuilder] Remove global extension when a plugin is unloaded
Elia Geretto via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 28 05:52:53 PST 2019
EliaGeretto created this revision.
EliaGeretto added reviewers: grosser, chandlerc.
Herald added subscribers: llvm-commits, hiraditya, mehdi_amini.
Herald added a project: LLVM.
This commit fixes PR39321.
GlobalExtensions is not guaranteed to be destroyed when optimizer plugins are unloaded. If it is indeed destroyed after a plugin is dlclose-d, the destructor of the corresponding ExtensionFn is not mapped anymore, causing a call to unmapped memory during destruction.
This commit guarantees that extensions coming from external plugins are removed from GlobalExtensions when the plugin is unloaded if GlobalExtensions has not been destroyed yet.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D71959
Files:
llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h
llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71959.235472.patch
Type: text/x-patch
Size: 4435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191228/0e05d504/attachment.bin>
More information about the llvm-commits
mailing list