From: Alexis Hetu Date: Fri, 22 Jun 2018 20:02:55 +0000 (-0400) Subject: Memory leak fix X-Git-Tag: android-x86-7.1-r3 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fexternal-swiftshader.git;a=commitdiff_plain;h=refs%2Ftags%2Fandroid-x86-8.1-r4 Memory leak fix Early returns were erroneous and were causing memory leaks Change-Id: Ifd6e37d79b6abd3f7d8d8899c951f1a0b4a66fb0 Reviewed-on: https://swiftshader-review.googlesource.com/19588 Reviewed-by: Nicolas Capens Tested-by: Nicolas Capens --- diff --git a/src/Reactor/Optimizer.cpp b/src/Reactor/Optimizer.cpp index 15c5f8464..aac8c0482 100644 --- a/src/Reactor/Optimizer.cpp +++ b/src/Reactor/Optimizer.cpp @@ -150,14 +150,14 @@ namespace if(!llvm::isa(alloca)) { - return; // Allocas are all at the top + break; // Allocas are all at the top } Ice::Operand *address = alloca.getDest(); if(!hasUses(address)) { - return; + continue; } const auto &addressUses = *getUses(address); @@ -213,14 +213,14 @@ namespace if(!llvm::isa(alloca)) { - return; // Allocas are all at the top + break; // Allocas are all at the top } Ice::Operand *address = alloca.getDest(); if(!hasUses(address)) { - return; + continue; } auto &addressUses = *getUses(address); @@ -324,14 +324,14 @@ namespace if(!llvm::isa(alloca)) { - return; // Allocas are all at the top + break; // Allocas are all at the top } Ice::Operand *address = alloca.getDest(); if(!hasUses(address)) { - return; + continue; } const auto &addressUses = *getUses(address);