+2020-06-26 Nick Alcock <nick.alcock@oracle.com>
+
+ * ctf-create.c (ctf_add_forward): Intern in the right namespace.
+ (ctf_dtd_delete): Remove correspondingly.
+ (ctf_rollback): Likewise.
+
2020-06-26 Nick Alcock <nick.alcock@oracle.com>
* ctf-create.c (ctf_add_type_internal): Hand back existing types
{
ctf_dmdef_t *dmd, *nmd;
int kind = LCTF_INFO_KIND (fp, dtd->dtd_data.ctt_info);
+ int name_kind = kind;
const char *name;
ctf_dynhash_remove (fp->ctf_dthash, (void *) dtd->dtd_type);
case CTF_K_FUNCTION:
free (dtd->dtd_u.dtu_argv);
break;
+ case CTF_K_FORWARD:
+ name_kind = dtd->dtd_data.ctt_type;
+ break;
}
if (dtd->dtd_data.ctt_name
&& (name = ctf_strraw (fp, dtd->dtd_data.ctt_name)) != NULL
&& LCTF_INFO_ISROOT (fp, dtd->dtd_data.ctt_info))
{
- ctf_dynhash_remove (ctf_name_table (fp, kind)->ctn_writable,
+ ctf_dynhash_remove (ctf_name_table (fp, name_kind)->ctn_writable,
name);
ctf_str_remove_ref (fp, name, &dtd->dtd_data.ctt_name);
}
continue;
kind = LCTF_INFO_KIND (fp, dtd->dtd_data.ctt_info);
+ if (kind == CTF_K_FORWARD)
+ kind = dtd->dtd_data.ctt_type;
if (dtd->dtd_data.ctt_name
&& (name = ctf_strraw (fp, dtd->dtd_data.ctt_name)) != NULL
if (type)
return type;
- if ((type = ctf_add_generic (fp, flag, name, CTF_K_FORWARD, &dtd)) == CTF_ERR)
+ if ((type = ctf_add_generic (fp, flag, name, kind, &dtd)) == CTF_ERR)
return CTF_ERR; /* errno is set for us. */
dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_FORWARD, flag, 0);