[Lldb-commits] [lldb] [LLDB] Update DIL assignment to respect ValueObject::CanSetValue (PR #217960)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Aug 21 11:26:40 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: cmtice
<details>
<summary>Changes</summary>
This will prevent DIL from allowing users to try to assign new values in cases where that could lead to incorrect behavior.
---
Full diff: https://github.com/llvm/llvm-project/pull/217960.diff
1 Files Affected:
- (modified) lldb/source/ValueObject/DILEval.cpp (+4)
``````````diff
diff --git a/lldb/source/ValueObject/DILEval.cpp b/lldb/source/ValueObject/DILEval.cpp
index d448444b43eba..9be288173e8f3 100644
--- a/lldb/source/ValueObject/DILEval.cpp
+++ b/lldb/source/ValueObject/DILEval.cpp
@@ -971,6 +971,10 @@ llvm::Expected<lldb::ValueObjectSP>
Interpreter::EvaluateAssignment(lldb::ValueObjectSP lhs,
lldb::ValueObjectSP rhs, uint32_t location) {
+ // Verify that lhs can accept an assignment.
+ if (llvm::Error err = lhs->CanSetValue())
+ return err;
+
auto all_ok =
VerifyAssignmentTypes(lhs->GetCompilerType(), rhs->GetCompilerType());
if (!all_ok)
``````````
</details>
https://github.com/llvm/llvm-project/pull/217960
More information about the lldb-commits
mailing list