[Mesa-dev] [PATCH] radeon: Initialize variables in radeon_llvm_context_init.
Michel Dänzer
michel at daenzer.net
Tue May 21 04:23:04 PDT 2013
On Sam, 2013-05-18 at 00:28 -0700, Vinson Lee wrote:
> 'type' was not fully initialized when calling lp_build_context_init.
>
> Fixes "Uninitialized scalar variable" defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> index 0629b89..972655e 100644
> --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
> @@ -1172,7 +1172,9 @@ void radeon_llvm_context_init(struct radeon_llvm_context * ctx)
> /* XXX: We need to revisit this.I think the correct way to do this is
> * to use length = 4 here and use the elem_bld for everything. */
> type.floating = TRUE;
> + type.fixed = FALSE;
> type.sign = TRUE;
> + type.norm = FALSE;
> type.width = 32;
> type.length = 1;
Might be safer to use memset? Either way:
NOTE: This is a candidate for the stable branches.
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Debian, X and DRI developer
More information about the mesa-dev
mailing list