[Mesa-dev] [PATCH 6/6] nir: check malloc return value in print_block()
Juha-Pekka Heikkila
juhapekka.heikkila at gmail.com
Tue Feb 10 03:52:41 PST 2015
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
src/glsl/nir/nir_print.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index 9c07950..c250850 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -646,6 +646,9 @@ print_block(nir_block *block, print_var_state *state, unsigned tabs, FILE *fp)
nir_block **preds =
malloc(block->predecessors->entries * sizeof(nir_block *));
+ if (!preds)
+ return;
+
struct set_entry *entry;
unsigned i = 0;
set_foreach(block->predecessors, entry) {
--
1.8.5.1
More information about the mesa-dev
mailing list