[Lldb-commits] [lldb] [LLDB] Fix UBSan issue with ValueType enums. (PR #195540)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon May 4 22:02:50 PDT 2026


================

----------------
JDevlieghere wrote:

Would it be easier to give the enum an fixed underlying type
```suggestion
enum ValueType : uint32_t {
```
With a fixed underlying type, the enum's range becomes the full range of the underlying type and any bitmasked value is considered in range. 

Then you can do something like:
```
static constexpr unsigned ValueTypeSyntheticMask = 0x20;
```
which doesn't require having to update all the exhaustive switches.

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


More information about the lldb-commits mailing list