-
Notifications
You must be signed in to change notification settings - Fork 342
[lldb] Fix local buffer not being popped #10718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb] Fix local buffer not being popped #10718
Conversation
augusto2112
commented
May 21, 2025
- Explanation: On a recent change in GetDynamicTypeAndAddress_Existential, the local buffer was being pushed but never popped. This fixes the issue by introducing a new RAII data structure that will pop the local buffer when out of scope.
- Scope: Fixes potentially failing dynamic type resolution.
- Issues: rdar://148137949
- Risk: Low. This just makes sure the local buffer is popped after every time it is pushed, and the patch is fairly straightforward.
- Testing: Added a new test.
- Reviewers: @adrian-prantl
On a recent change in GetDynamicTypeAndAddress_Existential, the local buffer was being pushed but never popped. This fixes the issue by introducing a new RAII data structure that will pop the local buffer when out of scope. rdar://148137949
@swift-ci test |
uint64_t local_buffer_size) { | ||
MemoryReaderLocalBufferHolder::~MemoryReaderLocalBufferHolder() { | ||
if (m_memory_reader) | ||
m_memory_reader->popLocalBuffer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format
MemoryReaderLocalBufferHolder(LLDBMemoryReader *memory_reader) | ||
: m_memory_reader(memory_reader) {} | ||
|
||
LLDBMemoryReader *m_memory_reader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LLDBMemoryReader *m_memory_reader; | |
LLDBMemoryReader *m_memory_reader = nullptr; |
class LLDBMemoryReader; | ||
class MemoryReaderLocalBufferHolder { | ||
public: | ||
MemoryReaderLocalBufferHolder() : m_memory_reader(nullptr) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MemoryReaderLocalBufferHolder() : m_memory_reader(nullptr) {} | |
MemoryReaderLocalBufferHolder() = default; |