[Beignet] [PATCH V2] GBE: initialize BTI structure to zero.
Yang, Rong R
rong.r.yang at intel.com
Mon Aug 11 23:53:34 PDT 2014
LGTM, pushed, thanks.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Ruiling Song
> Sent: Monday, August 11, 2014 1:49 PM
> To: beignet at lists.freedesktop.org
> Cc: Song, Ruiling
> Subject: [Beignet] [PATCH V2] GBE: initialize BTI structure to zero.
>
> 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
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list