summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-05-05 13:59:11 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-05-05 13:06:05 +0000
commite201fcd6146e1dba2a4c90623fdeea39abda2389 (patch)
treef1bd9ca504a4bc9fa540f64270c96b06a6d718f1
parent2549d1b3224bdca399837b5b9c7dfc40857f8bac (diff)
Don't dwfl_addrmodule with a nullptr Dwflv4.3.1v4.3.0-rc1v4.3.04.3
The result is undefined as dwfl_addrsegment doesn't set mod then. Change-Id: I3c08519726b8c136e7c24cfc89c34ffc78689619 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--app/perfsymboltable.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/perfsymboltable.cpp b/app/perfsymboltable.cpp
index 9516283..0ddbe56 100644
--- a/app/perfsymboltable.cpp
+++ b/app/perfsymboltable.cpp
@@ -61,7 +61,8 @@ static bool accessDsoMem(Dwfl *dwfl, const PerfUnwind::UnwindInfo *ui, Dwarf_Add
Dwarf_Word *result)
{
// TODO: Take the pgoff into account? Or does elf_getdata do that already?
- Dwfl_Module *mod = dwfl_addrmodule(dwfl, addr);
+ Dwfl_Module *mod = dwfl ? dwfl_addrmodule(dwfl, addr) : nullptr;
+
if (!mod) {
mod = ui->unwind->reportElf(addr, ui->sample->pid(), ui->sample->time());
if (!mod)