[PATCH] D61165: Fix a crash where a [[no_destroy]] destructor was not emitted in an array
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 25 17:47:42 PDT 2019
erik.pilkington created this revision.
erik.pilkington added reviewers: rjmccall, rsmith, jfb.
Herald added subscribers: dexonsmith, jkorous.
Herald added a project: clang.
Previously, we didn't mark an array's element type's destructor referenced when it was annotated with no_destroy. This is not correct: we still need the destructor if we need to do any cleanup if an element's constructor throws. This was leading to crashes and linker errors. The fix is just to mark the destructor referenced in the array case.
This leads to an inconsistency with access control: If the array element type's destructor is used, then we really ought check its access. However, that would be a source breaking change. This patch ignores access checking, which is a bit unfortunate, but I think its the best we can do if we're not willing to break source compatibility.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4025 bytes
Desc: not available
More information about the cfe-commits