[Mesa-dev] [PATCH 3/3] intel: compiler: prevent integer overflow

Matt Turner mattst88 at gmail.com
Mon May 8 23:17:21 UTC 2017


On Mon, May 8, 2017 at 3:02 PM, Lionel Landwerlin
<lionel.g.landwerlin at intel.com> wrote:
> CID: 1399477, 1399478 (Integer handling issues)
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> Cc: Matt Turner <mattst88 at gmail.com>
> ---
>  src/intel/compiler/brw_eu_validate.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
> index 2db7c5a915c..39728c19cac 100644
> --- a/src/intel/compiler/brw_eu_validate.c
> +++ b/src/intel/compiler/brw_eu_validate.c
> @@ -621,7 +621,7 @@ general_restrictions_on_region_parameters(const struct gen_device_info *devinfo,
>        /* VertStride must be used to cross GRF register boundaries. This rule
>         * implies that elements within a 'Width' cannot cross GRF boundaries.
>         */
> -      const uint64_t mask = (1 << element_size) - 1;
> +      const uint64_t mask = (1ULL << element_size) - 1;

element_size is in bytes, so this is completely benign. I have no
preference or objection. Feel free to have an

Acked-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list