[Beignet] [Patch v2 1/2] reset the variables in printf_paser to NULL.

Luo, Xionghu xionghu.luo at intel.com
Mon Oct 19 20:19:19 PDT 2015


Correct comments below.
"memeory leak" change to "segment fault".

Luo Xionghu
Best Regards

-----Original Message-----
From: Luo, Xionghu 
Sent: Tuesday, October 20, 2015 3:11 PM
To: beignet at lists.freedesktop.org
Cc: Luo, Xionghu
Subject: [Patch v2 1/2] reset the variables in printf_paser to NULL.

From: Luo Xionghu <xionghu.luo at intel.com>

the printfPaser variables g1Xg2Xg3 and wg_offset should be reinit after the builder is deleted, or else the variables will be freed and caused memory leak;

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 backend/src/llvm/llvm_printf_parser.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/backend/src/llvm/llvm_printf_parser.cpp b/backend/src/llvm/llvm_printf_parser.cpp
index 1e8427c..bdaed8a 100644
--- a/backend/src/llvm/llvm_printf_parser.cpp
+++ b/backend/src/llvm/llvm_printf_parser.cpp
@@ -723,6 +723,8 @@ error:
 
     deadprintfs.clear();
     delete builder;
+    g1Xg2Xg3 = NULL;
+    wg_offset = NULL;
 
     return changed;
   }
--
1.9.1



More information about the Beignet mailing list