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 <[email protected]> --- 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 _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
