From: Ben Pfaff Date: Thu, 5 May 2005 06:59:54 +0000 (+0000) Subject: Fix PR 12948. X-Git-Tag: v0.4.0~89 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e8d6804cd1c81b397394358a9361b5efb883fc8;p=pspp-builds.git Fix PR 12948. --- diff --git a/src/ChangeLog b/src/ChangeLog index 57d7b856..932fba3e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +Wed May 4 23:54:02 2005 Ben Pfaff + + Fix PR 12948. See also new test in + tests/bugs/match-file-scratch.sh. + + * get.c: (mtf_merge_dictionary) Don't compact dictionary because + that deletes scratch variables that someone else might be using, + and because we can't reassign our sources' value indexes. + Instead, simply don't copy scratch variables into the master + dictionary. + + * dictionary.c: (dict_compact_values) Delete variables from the + dictionary passed in, not from default_dict (!). + Tue May 3 22:25:17 2005 Ben Pfaff Improve hash.c comments, error-checking. diff --git a/src/dictionary.c b/src/dictionary.c index 43b4f779..d4ff2256 100644 --- a/src/dictionary.c +++ b/src/dictionary.c @@ -450,7 +450,6 @@ dict_delete_var (struct dictionary *d, struct variable *v) assert (d != NULL); assert (v != NULL); assert (dict_contains_var (d, v)); - assert (d->var[v->index] == v); /* Delete aux data. */ var_clear_aux (v); @@ -789,7 +788,7 @@ dict_compact_values (struct dictionary *d) i++; } else - dict_delete_var (default_dict, v); + dict_delete_var (d, v); } } diff --git a/src/get.c b/src/get.c index 0073383b..5ec84482 100644 --- a/src/get.c +++ b/src/get.c @@ -957,6 +957,8 @@ cmd_match_files (void) } } + /* Set up mapping from each file's variables to master + variables. */ for (iter = mtf.head; iter != NULL; iter = iter->next) { struct dictionary *d = iter->dict; @@ -971,6 +973,7 @@ cmd_match_files (void) } } + /* Add IN variables to master dictionary. */ for (iter = mtf.head; iter != NULL; iter = iter->next) if (iter->in_name != NULL) { @@ -1398,13 +1401,14 @@ mtf_merge_dictionary (struct dictionary *const m, struct mtf_file *f) } } - dict_compact_values (d); - for (i = 0; i < dict_get_var_cnt (d); i++) { struct variable *dv = dict_get_var (d, i); struct variable *mv = dict_lookup_var (m, dv->name); + if (dict_class_from_id (dv->name) == DC_SCRATCH) + continue; + if (mv != NULL) { if (mv->width != dv->width) diff --git a/tests/ChangeLog b/tests/ChangeLog index 836eda2e..a45dfd3f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +Wed May 4 23:50:02 2005 Ben Pfaff + + * bugs/match-files-scratch.sh: New test for PR 12948. + + * Makefile.am: (TESTS) Add bugs/match-files-scratch.sh. + Sun May 1 23:18:37 2005 Ben Pfaff Most tests: changed capitalization of variable names in diff --git a/tests/Makefile.am b/tests/Makefile.am index f2cabf49..d5ffed1f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -65,6 +65,7 @@ TESTS = \ bugs/html-frequency.sh \ bugs/if_crash.sh \ bugs/lag_crash.sh \ + bugs/match-files-scratch.sh \ bugs/multipass.sh \ bugs/random.sh \ bugs/t-test-with-temp.sh \