Index: lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp =================================================================== --- lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp +++ lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp @@ -402,12 +402,22 @@ assert(reg_info.name); uint32_t i; if (reg_info.value_regs) { - for (i = 0; reg_info.value_regs[i] != LLDB_INVALID_REGNUM; ++i) - m_value_regs_map[reg_num].push_back(reg_info.value_regs[i]); + reg_num_collection ®s = m_value_regs_map[reg_num]; + for (i = 0;; ++i) { + regs.push_back(reg_info.value_regs[i]); + if (reg_info.value_regs[i] == LLDB_INVALID_REGNUM) + break; + } + reg_info.value_regs = regs.data(); } if (reg_info.invalidate_regs) { - for (i = 0; reg_info.invalidate_regs[i] != LLDB_INVALID_REGNUM; ++i) - m_invalidate_regs_map[reg_num].push_back(reg_info.invalidate_regs[i]); + reg_num_collection ®s = m_invalidate_regs_map[reg_num]; + for (i = 0;; ++i) { + regs.push_back(reg_info.invalidate_regs[i]); + if (reg_info.invalidate_regs[i] == LLDB_INVALID_REGNUM) + break; + } + reg_info.invalidate_regs = regs.data(); } if (reg_info.dynamic_size_dwarf_expr_bytes) { for (i = 0; i < reg_info.dynamic_size_dwarf_len; ++i)