[Lldb-commits] [lldb] [lldb] Make ValueObjectDynamicValue::UpdateValue() point to a host b… (PR #125143)

via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 31 12:02:19 PST 2025


jimingham wrote:

Maybe I'm missing something.  In the host case, m_address is set to invalid, but m_value has the address in it and is a host address, so then we get to:

  // m_address could be invalid but we could still have a local buffer
   // containing the dynamic value.
   if ((m_address.IsValid() ||
        m_value.GetValueType() == Value::ValueType::HostAddress) &&
       m_dynamic_type_info) {
     // The variable value is in the Scalar value inside the m_value. We can
     // point our m_data right to it.
     m_error = m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());

So that's going to try to call GetValueAsData on a value you've added the dynamic type info to, and that type could be bigger than the static value, causing us to read too much from the data buffer.

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


More information about the lldb-commits mailing list