forked from Imagelibrary/binutils-gdb
libctf: strings: don't check for non-deduplicable atoms in the parent
Callers of ctf_str_add_no_dedup_ref are indicating that they would like the string they have added a reference to to appear in the current dict and not be deduplicated into the parent. This is true even if the string already exists in the parent, so we should not check for strings in the parent and reuse them in this case.
This commit is contained in:
@@ -313,11 +313,12 @@ ctf_str_add_ref_internal (ctf_dict_t *fp, const char *str,
|
||||
int added = 0;
|
||||
ctf_dict_t *lookup_fp = fp;
|
||||
|
||||
/* Check for existing atoms in the parent as well. */
|
||||
/* Check for existing atoms in the parent as well, unless they are marked
|
||||
non-deduplicable. */
|
||||
|
||||
atom = ctf_dynhash_lookup (fp->ctf_str_atoms, str);
|
||||
|
||||
if (!atom && fp->ctf_parent)
|
||||
if (!atom && fp->ctf_parent && !(flags & CTF_STR_NO_DEDUP))
|
||||
{
|
||||
lookup_fp = fp->ctf_parent;
|
||||
atom = ctf_dynhash_lookup (lookup_fp->ctf_str_atoms, str);
|
||||
|
||||
Reference in New Issue
Block a user