On 04/07/2016 11:35 AM, Nicolai Hähnle wrote:
From: Nicolai Hähnle <[email protected]>The literal 1 is a (signed) int, and shifting into the sign bit is undefined in C, so change occurences of 1 to 1u. --- src/gallium/auxiliary/tgsi/tgsi_scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index d90fb1d..0eb8c68 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -464,7 +464,7 @@ scan_declaration(struct tgsi_shader_info *info, } } } else if (file == TGSI_FILE_SAMPLER) { - info->samplers_declared |= 1 << reg; + info->samplers_declared |= 1u << reg; } else if (file == TGSI_FILE_SAMPLER_VIEW) { unsigned target = fulldecl->SamplerView.Resource; assert(target < TGSI_TEXTURE_UNKNOWN); @@ -540,6 +540,8 @@ tgsi_scan_shader(const struct tgsi_token *tokens, for (i = 0; i < Elements(info->sampler_targets); i++) info->sampler_targets[i] = TGSI_TEXTURE_UNKNOWN; + assert(sizeof(info->samplers_declared) * 8 >= PIPE_MAX_SAMPLERS); + /** ** Setup to begin parsing input shader **/
For 1-4, Reviewed-by: Brian Paul <[email protected]> _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
