+2007-10-27 John Darrington <john@darrington.wattle.id.au>
+
+ * dictionary.c: Fixed bug in dict_clone, where the vardict.dict member
+ wasn't initialised correctly. Closes bugs #21330 and 21397
+
+
2007-10-08 Ben Pfaff <blp@gnu.org>
Fix bug #21280. Thanks to John Darrington for review.
for (i = 0; i < s->var_cnt; i++)
{
+ const struct vardict_info *svdi;
+ struct vardict_info dvdi;
struct variable *sv = s->var[i];
struct variable *dv = dict_clone_var_assert (d, sv, var_get_name (sv));
size_t i;
for (i = 0; i < var_get_short_name_cnt (sv); i++)
var_set_short_name (dv, i, var_get_short_name (sv, i));
- var_set_vardict (dv, var_get_vardict (sv));
+ svdi = var_get_vardict (sv);
+ dvdi = *svdi;
+ dvdi.dict = d;
+ var_set_vardict (dv, &dvdi);
}
d->next_value_idx = s->next_value_idx;
result = hsh_find (d->name_tab, target);
var_destroy (target);
+ if ( result && var_has_vardict (result))
+ {
+ const struct vardict_info *vdi = var_get_vardict (result);
+ assert (vdi->dict == d);
+ }
+
return result;
}
if ( var_has_vardict (v))
{
const struct vardict_info *vdi = var_get_vardict (v);
- struct dictionary *d;
-
- d = vdi->dict;
+ struct dictionary *d = vdi->dict;
if ( d->callbacks && d->callbacks->var_changed )
d->callbacks->var_changed (d, var_get_dict_index (v), d->cb_data);