From 8db43501d5e334278970cca1d52014dcf17a4b24 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 14 Aug 2015 18:51:50 -0400 Subject: [PATCH] JitInterface: Fix null checking in GetProfileResults Technically a null pointer dereference can occur here. --- Source/Core/Core/PowerPC/JitInterface.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index df8f87bea0..5ea59517a5 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -133,15 +133,15 @@ namespace JitInterface void GetProfileResults(ProfileStats* prof_stats) { + // Can't really do this with no jit core available + if (!jit) + return; + prof_stats->cost_sum = 0; prof_stats->timecost_sum = 0; prof_stats->block_stats.clear(); prof_stats->block_stats.reserve(jit->GetBlockCache()->GetNumBlocks()); - // Can't really do this with no jit core available - if (!jit) - return; - Core::EState old_state = Core::GetState(); if (old_state == Core::CORE_RUN) Core::SetState(Core::CORE_PAUSE);