Commit 41b77484 by Alexis Hetu Committed by Nicolas Capens

Memory leak fix

Early returns were erroneous and were causing memory leaks Change-Id: Ifd6e37d79b6abd3f7d8d8899c951f1a0b4a66fb0 Reviewed-on: https://swiftshader-review.googlesource.com/19588Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 932640b2
...@@ -150,14 +150,14 @@ namespace ...@@ -150,14 +150,14 @@ namespace
if(!llvm::isa<Ice::InstAlloca>(alloca)) if(!llvm::isa<Ice::InstAlloca>(alloca))
{ {
return; // Allocas are all at the top break; // Allocas are all at the top
} }
Ice::Operand *address = alloca.getDest(); Ice::Operand *address = alloca.getDest();
if(!hasUses(address)) if(!hasUses(address))
{ {
return; continue;
} }
const auto &addressUses = *getUses(address); const auto &addressUses = *getUses(address);
...@@ -213,14 +213,14 @@ namespace ...@@ -213,14 +213,14 @@ namespace
if(!llvm::isa<Ice::InstAlloca>(alloca)) if(!llvm::isa<Ice::InstAlloca>(alloca))
{ {
return; // Allocas are all at the top break; // Allocas are all at the top
} }
Ice::Operand *address = alloca.getDest(); Ice::Operand *address = alloca.getDest();
if(!hasUses(address)) if(!hasUses(address))
{ {
return; continue;
} }
auto &addressUses = *getUses(address); auto &addressUses = *getUses(address);
...@@ -324,14 +324,14 @@ namespace ...@@ -324,14 +324,14 @@ namespace
if(!llvm::isa<Ice::InstAlloca>(alloca)) if(!llvm::isa<Ice::InstAlloca>(alloca))
{ {
return; // Allocas are all at the top break; // Allocas are all at the top
} }
Ice::Operand *address = alloca.getDest(); Ice::Operand *address = alloca.getDest();
if(!hasUses(address)) if(!hasUses(address))
{ {
return; continue;
} }
const auto &addressUses = *getUses(address); const auto &addressUses = *getUses(address);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment