From: Rob Clark <robcl...@freedesktop.org> For example, at nir_lower_locals_to_regs.c:365:
CID 1358911 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)7. var_deref_op: Dereferencing null pointer deref_ptr. I'm pretty sure that coverity doesn't understand the relationship between arr->data and arr->size. I think throwing in a !null check should do the trick. --- src/compiler/nir/nir_array.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_array.h b/src/compiler/nir/nir_array.h index 1db4e8c..2f57833 100644 --- a/src/compiler/nir/nir_array.h +++ b/src/compiler/nir/nir_array.h @@ -89,7 +89,7 @@ nir_array_grow(nir_array *arr, size_t additional) #define nir_array_foreach(arr, type, elem) \ for (type *elem = (type *)(arr)->data; \ - elem < (type *)((char *)(arr)->data + (arr)->size); elem++) + elem && (elem < (type *)((char *)(arr)->data + (arr)->size)); elem++) #ifdef __cplusplus } /* extern "C" */ -- 2.5.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev