[Lldb-commits] [PATCH] D11323: Initialize variable to prevent garbage values (RenderScriptRuntime)

Neil Parikh parikh.neil at me.com
Fri Jul 17 19:25:58 PDT 2015


neilparikh created this revision.
neilparikh added a reviewer: domipheus.
neilparikh added a subscriber: lldb-commits.
neilparikh set the repository for this revision to rL LLVM.

The kernels_found variable is not initialized, so if it is not assigned true on line 823, then it will be a garbage value in the branch condition on line 828. This patch initializes the variable to false. I'm assuming that if it's not set, then it was not found. I'm not 100% sure about this, so a confirmation of this would be good.

This is my first patch to an LLVM project, so please let me know if there's anything I need to fix. I haven't built or run the test suite yet, but if it's required to commit the patch, I can look into figuring that out.


Repository:
  rL LLVM

http://reviews.llvm.org/D11323

Files:
  RenderScriptRuntime.cpp

Index: RenderScriptRuntime.cpp
===================================================================
--- RenderScriptRuntime.cpp
+++ RenderScriptRuntime.cpp
@@ -776,7 +776,7 @@
         return;
     }
 
-    bool kernels_found;
+    bool kernels_found = false;
     ConstString kernel_name(name);
     for (const auto &module : m_rsmodules)
     {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11323.30064.patch
Type: text/x-patch
Size: 346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150718/c630fcdf/attachment.bin>


More information about the lldb-commits mailing list