https://github.com/cmtice created 
https://github.com/llvm/llvm-project/pull/217960

This will prevent DIL from allowing users to try to assign new values in cases 
where that could lead to incorrect behavior.

>From d745ba255716a7c3e0cea1a679e824d41def8904 Mon Sep 17 00:00:00 2001
From: cmtice <[email protected]>
Date: Fri, 21 Aug 2026 15:55:07 +0000
Subject: [PATCH] [LLDB] Update DIL assignment to respect
 ValueObject::CanSetValue

This will prevent DIL from allowing users to try to assign new
values in cases where that could lead to incorrect behavior.
---
 lldb/source/ValueObject/DILEval.cpp | 4 ++++
 1 file changed, 4 insertions(+)

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)

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

Reply via email to