From 18be7403a11f53d58bbfe3905c0cacd6bc714492 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Wed, 15 Aug 2018 15:46:23 +0300 Subject: [PATCH] glsl: Add an assert when cloning ir_dereference_record with invalid field Signed-off-by: Danylo Piliaiev Reviewed-by: Timothy Arceri --- src/compiler/glsl/ir_clone.cpp | 1 + 1 file changed, 1 insertion(+) 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), -- 2.30.2