From ac408ab21a769581289472f3af4f9bcfd8814e86 Mon Sep 17 00:00:00 2001 From: Nikolai Nosov Date: Mon, 3 Feb 2020 15:46:22 +0400 Subject: [PATCH] small refactoring --- framework/dwarf_stack.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/framework/dwarf_stack.cpp b/framework/dwarf_stack.cpp index ffb715e..ea7bbfe 100644 --- a/framework/dwarf_stack.cpp +++ b/framework/dwarf_stack.cpp @@ -209,14 +209,11 @@ bool pst_dwarf_stack_calc(pst_dwarf_stack* st, Dwarf_Op *exprs, int expr_len, Dw // handle there because it contains sub-expression of a Location in caller's frame if(map->op_num == DW_OP_GNU_entry_value) { - if(!fun) { - pst_log(SEVERITY_ERROR, "Cannot calculate DW_OP_GNU_entry_value expression while function is undefined"); - return false; - } - if(!fun->parent) { - pst_log(SEVERITY_ERROR, "Function has not parent while calculate DW_OP_GNU_entry_value expression"); + if(!fun || !fun->parent) { + pst_log(SEVERITY_ERROR, "Cannot calculate DW_OP_GNU_entry_value expression while function and it's caller is undefined"); return false; } + // This opcode has two operands, the first one is uleb128 length and the second is block of that length, containing either a // simple register or DWARF expression Dwarf_Attribute attr_mem;