forked from OSchip/llvm-project
Avoid LLDB crash upon DW_OP_deref* with empty stack
As done in other DW_OP_* cases, return an error if the stack is empty rather than eventually crashing elsewhere. Encountered on big-endian MIPS, where LLVM bugs currently result in invalid .debug_loc data. llvm-svn: 199110
This commit is contained in:
parent
7d074a5ad6
commit
9344787636
|
@ -1429,6 +1429,12 @@ DWARFExpression::Evaluate
|
|||
//----------------------------------------------------------------------
|
||||
case DW_OP_deref:
|
||||
{
|
||||
if (stack.empty())
|
||||
{
|
||||
if (error_ptr)
|
||||
error_ptr->SetErrorString("Expression stack empty for DW_OP_deref.");
|
||||
return false;
|
||||
}
|
||||
Value::ValueType value_type = stack.back().GetValueType();
|
||||
switch (value_type)
|
||||
{
|
||||
|
@ -1504,6 +1510,12 @@ DWARFExpression::Evaluate
|
|||
//----------------------------------------------------------------------
|
||||
case DW_OP_deref_size:
|
||||
{
|
||||
if (stack.empty())
|
||||
{
|
||||
if (error_ptr)
|
||||
error_ptr->SetErrorString("Expression stack empty for DW_OP_deref_size.");
|
||||
return false;
|
||||
}
|
||||
uint8_t size = opcodes.GetU8(&offset);
|
||||
Value::ValueType value_type = stack.back().GetValueType();
|
||||
switch (value_type)
|
||||
|
|
Loading…
Reference in New Issue