llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Ebuka Ezike (da-viper)

<details>
<summary>Changes</summary>

Return UINT32_MAX instead of 0 when SBSymbol has no underlying symbol, since 0 
is a valid symbol ID. 
This makes it possible to distinguish between a valid symbol with ID 0 and an 
invalid/uninitialised symbol.

>From https://github.com/llvm/llvm-project/pull/172687#discussion_r2628319927

---
Full diff: https://github.com/llvm/llvm-project/pull/175545.diff


1 Files Affected:

- (modified) lldb/source/API/SBSymbol.cpp (+1-1) 


``````````diff
diff --git a/lldb/source/API/SBSymbol.cpp b/lldb/source/API/SBSymbol.cpp
index fd68a3820181d..73f082ebde6a3 100644
--- a/lldb/source/API/SBSymbol.cpp
+++ b/lldb/source/API/SBSymbol.cpp
@@ -207,7 +207,7 @@ uint32_t SBSymbol::GetID() const {
 
   if (m_opaque_ptr)
     return m_opaque_ptr->GetID();
-  return 0;
+  return UINT32_MAX;
 }
 
 bool SBSymbol::IsExternal() {

``````````

</details>


https://github.com/llvm/llvm-project/pull/175545
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to