[Mesa-dev] [PATCH] i965: Fix software primitive restart with indirect draws.

Ben Widawsky ben at bwidawsk.net
Sat Apr 11 11:48:06 PDT 2015


On Sat, Apr 11, 2015 at 09:40:36AM -0700, Matt Turner wrote:
> On Sat, Apr 11, 2015 at 2:46 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> > new_prim was declared as a stack variable within a nested scope; we
> > tried to retain a pointer to that data beyond the scope, which is bogus.
> >
> > GCC with -O1 eliminated most of the code that set new_prim's fields.
> >
> > Move the declaration to fix the bug.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81025
> > Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> > Cc: Mark Janes <mark.a.janes at intel.com>
> > Cc: mesa-stable at lists.freedesktop.org
> > ---
> 
> Wow, yeah, that's awful.
> 
> Doesn't ib/new_ib suffer from the same problem?
> 
> With ib/new_ib fixed as well,

Good catch, Matt. It looks like it is needed to me as well. (The author and
reviewer of the original patch certainly make me feel better about the silly
mistakes I make).

Reviewed-by: Ben Widawsky <ben at bwidawsk.net>
> 
> Reviewed-by: Matt Turner <mattst88 at gmail.com>
> 
> FWIW, Coverity [0] has known about this since Dec 2013. I really
> recommend people use this. It'll send you emails about new defects,
> which is often nice because you just reviewed that code and missed
> something. :)
> 
> [0] https://scan.coverity.com/projects/139?tab=overview
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list