HomePhabricator

[lldb/api] Add checks for StackFrame::GetRegisterContext calls (NFC)
4547c8830be4Unpublished

Authored by mib on Jul 7 2020, 1:08 PM.

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

[lldb/api] Add checks for StackFrame::GetRegisterContext calls (NFC)

This patch fixes a crash that is happening because of a null pointer
dereference in SBFrame.

StackFrame::GetRegisterContext says explicitly that you might not get
a valid RegisterContext back but the pointer wasn't tested before,
resulting in crashes. This should solve the issue.

rdar://54462095

Differential Revision: https://reviews.llvm.org/D83343

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>