================
@@ -339,6 +337,18 @@ bool RegisterContextCorePOSIX_arm64::ReadRegister(const 
RegisterInfo *reg_info,
       value.SetFromMemoryData(*reg_info, src + sizeof(sve::user_za_header),
                               reg_info->byte_size, lldb::eByteOrderLittle,
                               error);
+    } else if (m_register_info_up->IsSMERegZT(reg)) {
+      value.SetFromMemoryData(*reg_info, m_zt_data.GetDataStart(),
+                              reg_info->byte_size, lldb::eByteOrderLittle,
+                              error);
+    } else {
+      offset = reg_info->byte_offset - m_register_info_up->GetSMEOffset();
+      assert(offset < sizeof(m_sme_pseudo_regs));
----------------
jasonmolenda wrote:

This would be someone trying to fetch a register that is at a greater offset 
than the register context buffer has.  My worry about the assert is more that 
in a non-debug/release build, there's no error checking, we'll read from past 
the end of the m_sme_psueo_regs buffer and copy it into value.
On the other hand, this does fall in to "this shouldn't ever happen", but maybe 
returning false here instead of filling in value would be the best choice.

https://github.com/llvm/llvm-project/pull/70934
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to