[Mesa-dev] [PATCH] spirv: replace assert with unreachable

Jason Ekstrand jason at jlekstrand.net
Mon Aug 29 19:38:13 UTC 2016


On Aug 29, 2016 12:06 PM, "Matt Turner" <mattst88 at gmail.com> wrote:
>
> On Sun, Aug 28, 2016 at 7:13 PM, Timothy Arceri
> <timothy.arceri at collabora.com> wrote:
> > Fixes uninitialised warning for coord_components.
> > ---
> >  src/compiler/spirv/spirv_to_nir.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/compiler/spirv/spirv_to_nir.c
b/src/compiler/spirv/spirv_to_nir.c
> > index ca404d8..fda38f9 100644
> > --- a/src/compiler/spirv/spirv_to_nir.c
> > +++ b/src/compiler/spirv/spirv_to_nir.c
> > @@ -1426,7 +1426,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp
opcode,
> >           coord_components = 3;
> >           break;
> >        default:
> > -         assert("Invalid sampler type");
> > +         unreachable("Invalid sampler type");
>
> Not only does it fix an uninitialized warning, the assert was *wrong*.
> It's missing the ! so it would have always been true!

Drp... Rb

> Reviewed-by: Matt Turner <mattst88 at gmail.com>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160829/a20d56d2/attachment.html>


More information about the mesa-dev mailing list