From 72155d2f05e38b265cb79a31abdbe65cd29d3a5b Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 25 Apr 2017 15:17:16 -0700 Subject: fix a null pointer dereference Caught by the static analyzer: art/compiler/optimizing/graph_checker.cc:501:10: warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage] Bug: None Test: Still builds; static analyzer no longer complains. Change-Id: Iba20a0cd859cca0cf38f6e10c3685cc986b5baa5 --- compiler/optimizing/graph_checker.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 34b52a87b5..12340b416d 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -497,8 +497,7 @@ void GraphChecker::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) { "has a null pointer as last input.", invoke->DebugName(), invoke->GetId())); - } - if (!last_input->IsClinitCheck() && !last_input->IsLoadClass()) { + } else if (!last_input->IsClinitCheck() && !last_input->IsLoadClass()) { AddError(StringPrintf("Static invoke %s:%d marked as having an explicit clinit check " "has a last instruction (%s:%d) which is neither a clinit check " "nor a load class instruction.", -- cgit v1.2.3-59-g8ed1b