[Mesa-dev] [PATCH 2/4] nouveau/compiler: init the size and code variables to NULL/0

Ilia Mirkin imirkin at alum.mit.edu
Fri Jun 5 06:53:35 PDT 2015


My recollection is that gcc's analysis is wrong. I can't look at the code
now, but I hate patches that appease broken tools. Will take a look when I
can get in front of a proper computer though.
On Jun 5, 2015 3:32 PM, "Martin Peres" <martin.peres at linux.intel.com> wrote:

> This should prevent any segfault when the codegen fails.
>
> Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
> ---
>  src/gallium/drivers/nouveau/nouveau_compiler.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/nouveau/nouveau_compiler.c
> b/src/gallium/drivers/nouveau/nouveau_compiler.c
> index 8660498..ca128b5 100644
> --- a/src/gallium/drivers/nouveau/nouveau_compiler.c
> +++ b/src/gallium/drivers/nouveau/nouveau_compiler.c
> @@ -144,7 +144,7 @@ main(int argc, char *argv[])
>     const char *filename = NULL;
>     FILE *f;
>     char text[65536] = {0};
> -   unsigned size, *code;
> +   unsigned size = 0, *code = NULL;
>
>     for (i = 1; i < argc; i++) {
>        if (!strcmp(argv[i], "-a"))
> --
> 2.4.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150605/4f529d41/attachment-0001.html>


More information about the mesa-dev mailing list