Skip to content

Commit 8fca758

Browse files
committed
Fix DialectContext destructor
It ended up destructing the extension pointers multiple times. Interestingly, this crashed on Windows before it did on Linux.
1 parent bc5d060 commit 8fca758

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/Dialect/Dialect.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ DialectContext::~DialectContext() {
194194

195195
std::unique_ptr<ContextExtensionBase> *extensionArray =
196196
getTrailingObjects<std::unique_ptr<ContextExtensionBase>>();
197-
for (unsigned i = 0; i < m_extensionArraySize; ++i)
198-
std::destroy_n(extensionArray, m_extensionArraySize);
197+
std::destroy_n(extensionArray, m_extensionArraySize);
199198

200199
Dialect **dialectArray = getTrailingObjects<Dialect *>();
201200
for (unsigned i = 0; i < m_dialectArraySize; ++i)

0 commit comments

Comments
 (0)