[Mesa-dev] [PATCH] gallium/tgsi/text: Ensure ret is initialized in parse_immediate_data.

Brian Paul brianp at vmware.com
Thu May 17 06:16:09 PDT 2012


On 05/17/2012 12:50 AM, Vinson Lee wrote:
> Fix uninitialized scalar variable defect reported by Coverity.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
>   src/gallium/auxiliary/tgsi/tgsi_text.c |    4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
> index 279a046..f2bf49e 100644
> --- a/src/gallium/auxiliary/tgsi/tgsi_text.c
> +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
> @@ -1007,6 +1007,10 @@ static boolean parse_immediate_data(struct translate_ctx *ctx, unsigned type,
>         case TGSI_IMM_INT32:
>            ret = parse_int(&ctx->cur,&values[i].Int);
>            break;
> +      default:
> +         assert(0);
> +         ret = FALSE;
> +         break;
>         }
>
>         if (!ret) {

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list