[Mesa-dev] [PATCH] nv50/ir: check for origin insn in findOriginForTestWithZero

Ilia Mirkin imirkin at alum.mit.edu
Sat Feb 18 19:54:16 UTC 2017


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Sat, Feb 18, 2017 at 12:51 PM, Pierre Moreau <pierre.morrow at free.fr> wrote:
> Function arguments do not have an "origin" instruction, causing a
> NULL-pointer dereference without this check.
>
> Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> index 79403c93df..d358abc5bd 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
> @@ -410,6 +410,8 @@ ConstantFolding::findOriginForTestWithZero(Value *value)
>     if (!value)
>        return NULL;
>     Instruction *insn = value->getInsn();
> +   if (!insn)
> +      return NULL;
>
>     if (insn->asCmp() && insn->op != OP_SLCT)
>        return insn->asCmp();
> --
> 2.11.1
>


More information about the mesa-dev mailing list