aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-05-08 18:55:06 +0100
committerLionel Landwerlin <[email protected]>2017-05-09 13:56:17 +0100
commit32f14332f561a68f1ad93b8b7bc2afa4ea1dc8db (patch)
tree17689f3a3f0f0bbd2775ac8a75696f6c645ce97b /src
parent85182e490cef5b52b697ec1664df66f0d1c8c42d (diff)
intel: compiler: prevent integer overflow
CID: 1399477, 1399478 (Integer handling issues) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_eu_validate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_eu_validate.c b/src/intel/compiler/brw_eu_validate.c
index 63b798c771a..a632242e0f8 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;
unsigned rowbase = subreg;
for (int y = 0; y < exec_size / width; y++) {
@@ -674,7 +674,7 @@ align1_access_mask(uint64_t access_mask[static 32],
unsigned exec_size, unsigned element_size, unsigned subreg,
unsigned vstride, unsigned width, unsigned hstride)
{
- const uint64_t mask = (1 << element_size) - 1;
+ const uint64_t mask = (1ULL << element_size) - 1;
unsigned rowbase = subreg;
unsigned element = 0;