- /* We don't want to modify this field if it's frozen */
- if (field->frozen) {
- BT_LOGW("Invalid parameter: field is frozen: addr=%p",
- field);
- goto end;
- }
-
- /* Field has not been instanciated yet, create it */
- structure_type = bt_ctf_field_get_type(field);
- assert(structure_type);
- ret = bt_ctf_field_type_structure_get_field(structure_type,
- &field_name, &field_type, index);
- assert(ret == 0);
- bt_put(structure_type);
- ret_field = bt_ctf_field_create(field_type);
- if (!ret_field) {
- BT_LOGW("Cannot create field: "
- "struct-field-addr=%p, struct-ft-addr=%p, "
- "field-ft-addr=%p, index=%" PRIu64,
- field, field->type, field_type, index);
- goto error;
- }
-
- structure->fields->pdata[index] = ret_field;