From: Danylo Piliaiev Date: Wed, 15 Aug 2018 12:46:23 +0000 (+0300) Subject: glsl: Add an assert when cloning ir_dereference_record with invalid field X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18be7403a11f53d58bbfe3905c0cacd6bc714492;p=mesa.git glsl: Add an assert when cloning ir_dereference_record with invalid field Signed-off-by: Danylo Piliaiev Reviewed-by: Timothy Arceri --- diff --git a/src/compiler/glsl/ir_clone.cpp b/src/compiler/glsl/ir_clone.cpp index 69441fae7de..e1f4f3b2903 100644 --- a/src/compiler/glsl/ir_clone.cpp +++ b/src/compiler/glsl/ir_clone.cpp @@ -194,6 +194,7 @@ ir_dereference_array::clone(void *mem_ctx, struct hash_table *ht) const ir_dereference_record * ir_dereference_record::clone(void *mem_ctx, struct hash_table *ht) const { + assert(this->field_idx >= 0); const char *field_name = this->record->type->fields.structure[this->field_idx].name; return new(mem_ctx) ir_dereference_record(this->record->clone(mem_ctx, ht),