[Mesa-dev] [PATCH] nvc0/ir: Fix assert accessing null pointer

Juan A. Suarez Romero jasuarez at igalia.com
Wed Jul 24 13:34:07 UTC 2019


On Wed, 2019-07-24 at 14:27 +0200, Karol Herbst wrote:
> it's only fixing a crash in a build with asserts enabled, but if
> somebody wants to apply those to stable, then go ahead.
> 

OK; in that case I will keep it out.

Thanks!

	J.A.

> On Wed, Jul 24, 2019 at 12:48 PM Juan A. Suarez Romero
> <jasuarez at igalia.com> wrote:
> > On Fri, 2019-07-19 at 13:56 +0200, Mark Menzynski wrote:
> > > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=111007
> > > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=111167
> > > Signed-off-by: Mark Menzynski <mmenzyns at redhat.com>
> > > ---
> > >  src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Looks like a good candidate for 19.1 stable. WDYT?
> > 
> >         J.A.
> > 
> > > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> > > index aca3b0afb1e..1f702a987d8 100644
> > > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> > > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> > > @@ -51,12 +51,12 @@ NVC0LegalizeSSA::handleDIV(Instruction *i)
> > >     // Generate movs to the input regs for the call we want to generate
> > >     for (int s = 0; i->srcExists(s); ++s) {
> > >        Instruction *ld = i->getSrc(s)->getInsn();
> > > -      assert(ld->getSrc(0) != NULL);
> > >        // check if we are moving an immediate, propagate it in that case
> > >        if (!ld || ld->fixed || (ld->op != OP_LOAD && ld->op != OP_MOV) ||
> > >              !(ld->src(0).getFile() == FILE_IMMEDIATE))
> > >           bld.mkMovToReg(s, i->getSrc(s));
> > >        else {
> > > +         assert(ld->getSrc(0) != NULL);
> > >           bld.mkMovToReg(s, ld->getSrc(0));
> > >           // Clear the src, to make code elimination possible here before we
> > >           // delete the instruction i later
> > 
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list