From 41b7748432efe3163e0ca3d586d88ba4dd6fb22f Mon Sep 17 00:00:00 2001 From: Alexis Hetu Date: Fri, 22 Jun 2018 16:02:55 -0400 Subject: [PATCH] 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 --- src/Reactor/Optimizer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); -- 2.11.0