Hardened LLDB against NULL conditions being

passed to breakpoints.

<rdar://problem/13853205>

llvm-svn: 181636
This commit is contained in:
Sean Callanan 2013-05-10 21:58:45 +00:00
parent d7193795bd
commit ec537a24eb
2 changed files with 6 additions and 0 deletions

View File

@ -254,7 +254,10 @@ BreakpointLocation::ConditionSaysStop (ExecutionContext &exe_ctx, Error &error)
const char *condition_text = GetConditionText(&condition_hash);
if (!condition_text)
{
m_user_expression_sp.reset();
return false;
}
if (condition_hash != m_condition_hash ||
!m_user_expression_sp ||

View File

@ -162,6 +162,9 @@ BreakpointOptions::HasCallback ()
void
BreakpointOptions::SetCondition (const char *condition)
{
if (!condition)
condition = "";
m_condition_text.assign(condition);
std::hash<std::string> hasher;
m_condition_text_hash = hasher(m_condition_text);