Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-swiftshader: Commit

external/swiftshader


Commit MetaInfo

Revision41b7748432efe3163e0ca3d586d88ba4dd6fb22f (tree)
Time2018-06-23 05:08:13
AuthorAlexis Hetu <sugoi@goog...>
CommiterNicolas Capens

Log Message

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 <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>

Change Summary

Incremental Difference

--- a/src/Reactor/Optimizer.cpp
+++ b/src/Reactor/Optimizer.cpp
@@ -150,14 +150,14 @@ namespace
150150
151151 if(!llvm::isa<Ice::InstAlloca>(alloca))
152152 {
153- return; // Allocas are all at the top
153+ break; // Allocas are all at the top
154154 }
155155
156156 Ice::Operand *address = alloca.getDest();
157157
158158 if(!hasUses(address))
159159 {
160- return;
160+ continue;
161161 }
162162
163163 const auto &addressUses = *getUses(address);
@@ -213,14 +213,14 @@ namespace
213213
214214 if(!llvm::isa<Ice::InstAlloca>(alloca))
215215 {
216- return; // Allocas are all at the top
216+ break; // Allocas are all at the top
217217 }
218218
219219 Ice::Operand *address = alloca.getDest();
220220
221221 if(!hasUses(address))
222222 {
223- return;
223+ continue;
224224 }
225225
226226 auto &addressUses = *getUses(address);
@@ -324,14 +324,14 @@ namespace
324324
325325 if(!llvm::isa<Ice::InstAlloca>(alloca))
326326 {
327- return; // Allocas are all at the top
327+ break; // Allocas are all at the top
328328 }
329329
330330 Ice::Operand *address = alloca.getDest();
331331
332332 if(!hasUses(address))
333333 {
334- return;
334+ continue;
335335 }
336336
337337 const auto &addressUses = *getUses(address);
Show on old repository browser