Author: Med Ismail Bennani Date: 2020-03-31T17:44:17+02:00 New Revision: e4a778052e98c6d67f601342a7ca3b3c52ce7fbd
URL: https://github.com/llvm/llvm-project/commit/e4a778052e98c6d67f601342a7ca3b3c52ce7fbd DIFF: https://github.com/llvm/llvm-project/commit/e4a778052e98c6d67f601342a7ca3b3c52ce7fbd.diff LOG: Revert "[lldb/DWARF] Fix evaluator crash when accessing empty stack." This reverts commit e26eece1e2e7d7e6fbadb1207afef9b6353b5330. Added: Modified: lldb/source/Expression/DWARFExpression.cpp lldb/unittests/Expression/DWARFExpressionTest.cpp Removed: ################################################################################ diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index 04fbfccd0c2e..7f12d06450c6 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -2318,12 +2318,6 @@ bool DWARFExpression::Evaluate( // rather is a constant value. The value from the top of the stack is the // value to be used. This is the actual object value and not the location. case DW_OP_stack_value: - if (stack.empty()) { - if (error_ptr) - error_ptr->SetErrorString( - "Expression stack needs at least 1 item for DW_OP_stack_value."); - return false; - } stack.back().SetValueType(Value::eValueTypeScalar); break; diff --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp b/lldb/unittests/Expression/DWARFExpressionTest.cpp index 4c4281983078..64755a9066de 100644 --- a/lldb/unittests/Expression/DWARFExpressionTest.cpp +++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp @@ -234,10 +234,6 @@ TEST(DWARFExpression, DW_OP_convert) { llvm::Failed()); } -TEST(DWARFExpression, DW_OP_stack_value) { - EXPECT_THAT_EXPECTED(Evaluate({DW_OP_stack_value}), llvm::Failed()); -} - TEST(DWARFExpression, DW_OP_piece) { EXPECT_THAT_EXPECTED(Evaluate({DW_OP_const2u, 0x11, 0x22, DW_OP_piece, 2, DW_OP_const2u, 0x33, 0x44, DW_OP_piece, 2}), _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits