[Mesa-dev] [PATCH] nir: change asserts to unreachable in nir_type_conversion_op

Samuel Iglesias Gonsálvez siglesias at igalia.com
Tue Jan 10 08:18:29 UTC 2017


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On Tue, 2017-01-10 at 10:14 +0200, Tapani Pälli wrote:
> this is to avoid following compilation error on Android:
> 
>    error: control may reach end of non-void function [-Werror,-
> Wreturn-type]
> 
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/compiler/nir/nir.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
> index a2af390..f82b670 100644
> --- a/src/compiler/nir/nir.c
> +++ b/src/compiler/nir/nir.c
> @@ -1998,7 +1998,7 @@ nir_type_conversion_op(nir_alu_type src,
> nir_alu_type dst)
>              return nir_op_f2i;
>           };
>        default:
> -         assert(!"Invalid conversion");
> +         unreachable("Invalid conversion");
>        };
>     }
>  
> @@ -2031,9 +2031,9 @@ nir_type_conversion_op(nir_alu_type src,
> nir_alu_type dst)
>        case nir_type_float:
>           return nir_op_d2f;
>        default:
> -         assert(!"Invalid conversion");
> +         unreachable("Invalid conversion");
>        };
>     default:
> -      assert(!"Invalid conversion");
> +      unreachable(!"Invalid conversion");
>     };
>  }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170110/032e00f3/attachment-0001.sig>


More information about the mesa-dev mailing list