mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 22:20:14 +01:00
glsl2: strdup the field names used in dereference_record.
Otherwise, after linking and freeing the old data, the pointer would dangle. Partial fix for glsl1-struct*.
This commit is contained in:
parent
21b0dbd799
commit
fade78edcb
1 changed files with 2 additions and 2 deletions
|
|
@ -514,7 +514,7 @@ ir_dereference_record::ir_dereference_record(ir_rvalue *value,
|
|||
{
|
||||
this->ir_type = ir_type_dereference_record;
|
||||
this->record = value;
|
||||
this->field = field;
|
||||
this->field = talloc_strdup(this, field);
|
||||
this->type = (this->record != NULL)
|
||||
? this->record->type->field_type(field) : glsl_type::error_type;
|
||||
}
|
||||
|
|
@ -527,7 +527,7 @@ ir_dereference_record::ir_dereference_record(ir_variable *var,
|
|||
|
||||
this->ir_type = ir_type_dereference_record;
|
||||
this->record = new(ctx) ir_dereference_variable(var);
|
||||
this->field = field;
|
||||
this->field = talloc_strdup(this, field);
|
||||
this->type = (this->record != NULL)
|
||||
? this->record->type->field_type(field) : glsl_type::error_type;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue