[Beignet] [PATCH V2] GBE: initialize BTI structure to zero.

Ruiling Song ruiling.song at intel.com
Sun Aug 10 22:49:01 PDT 2014


Clear to zero to avoid garbage data, as we do not
assign it later for local/constant memory access.

v2:
  move initialization code into constructor.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/ir/instruction.hpp |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backend/src/ir/instruction.hpp b/backend/src/ir/instruction.hpp
index e4c415e..0db950d 100644
--- a/backend/src/ir/instruction.hpp
+++ b/backend/src/ir/instruction.hpp
@@ -38,6 +38,10 @@ namespace ir {
   struct BTI {
     uint8_t bti[MAX_MIXED_POINTER];
     uint8_t count;
+    BTI() : count(0) {
+      memset(bti, 0, MAX_MIXED_POINTER);
+    }
+    ~BTI() {}
   };
 
   /*! All opcodes */
-- 
1.7.10.4



More information about the Beignet mailing list