Fixed a potential crash where we attempt to read

an invalid register.

<rdar://problem/12065366>

llvm-svn: 161679
This commit is contained in:
Sean Callanan 2012-08-10 18:35:24 +00:00
parent c52863cd36
commit d2a5a90148
1 changed files with 4 additions and 0 deletions

View File

@ -896,6 +896,10 @@ RegisterContextLLDB::ReadRegisterValueFromRegisterLocation (lldb_private::Unwind
case UnwindLLDB::RegisterLocation::eRegisterInRegister:
{
const RegisterInfo *other_reg_info = GetRegisterInfoAtIndex(regloc.location.register_number);
if (!other_reg_info)
return false;
if (IsFrameZero ())
{
success = m_thread.GetRegisterContext()->ReadRegister (other_reg_info, value);