From 25598171b1266973a1f2a32dd046b46b26b3edc9 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 22 Jul 2009 01:53:59 +0000 Subject: [PATCH] GetStatementAtAddress(): Terminate, if we couldn't get the statement from the disassembled code of the function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31685 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/model/Team.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/apps/debugger/model/Team.cpp b/src/apps/debugger/model/Team.cpp index 20889a8dc0..55537e52c8 100644 --- a/src/apps/debugger/model/Team.cpp +++ b/src/apps/debugger/model/Team.cpp @@ -242,12 +242,13 @@ printf(" -> no function instance\n"); // statement directly. if (DisassembledCode* code = functionInstance->GetSourceCode()) { Statement* statement = code->StatementAtAddress(address); - if (statement != NULL) { - statement->AcquireReference(); - _statement = statement; - _function = functionInstance; - return B_OK; - } + if (statement == NULL) + return B_ENTRY_NOT_FOUND; + + statement->AcquireReference(); + _statement = statement; + _function = functionInstance; + return B_OK; } // get the statement from the image debug info