Otherwise, after linking and freeing the old data, the pointer would
dangle. Partial fix for glsl1-struct*.
{
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;
}
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;
}