aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorDanylo Piliaiev <[email protected]>2018-08-15 15:46:23 +0300
committerTimothy Arceri <[email protected]>2018-09-20 08:30:11 +1000
commit18be7403a11f53d58bbfe3905c0cacd6bc714492 (patch)
tree4cfd4b8ecfe590acf1ddda69dc2cb68dcc3381b6 /src/compiler
parent6f3c7374b11299c21d829db794fad3b756af60fb (diff)
glsl: Add an assert when cloning ir_dereference_record with invalid field
Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/ir_clone.cpp1
1 files changed, 1 insertions, 0 deletions
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),