[Lldb-commits] [lldb] [lldb] Fix SBAddressRange validation checks. (PR #95997)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 20 09:15:57 PDT 2024


https://github.com/JDevlieghere requested changes to this pull request.

This class behaves quite differently from other SB API classes. Normally, the opaque pointer can be cleared to release the potentially more resource heavy private counterpart. `AddressRange` is a pretty simple class, so I understand that it makes things easier if we guarantee the pointer is always valid, but it is somewhat of a surprise. 

Personally, I think consistency beats the small advantage of not having to check the pointer. If we want to stick to this approach, I'd like to see an assert that makes it clear that in this class, we have a precondition that the pointer is always valid: 

```
assert(m_opaque_up && "opaque pointer must always be valid");
``` 

https://github.com/llvm/llvm-project/pull/95997


More information about the lldb-commits mailing list