X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fdescriptives.c;h=413826cc9cdaa64c7e9b10d503f80ceae15dc57c;hb=refs%2Fbuilds%2F20130902030504%2Fpspp;hp=94421ef1e979807776a954d354c5be08019fcccc;hpb=f5a7058281a9bb3954b1324c82a6e997b614ce35;p=pspp diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index 94421ef1e9..413826cc9c 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-2000, 2009-2012 Free Software Foundation, Inc. + Copyright (C) 1997-2000, 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -397,6 +397,13 @@ cmd_descriptives (struct lexer *lexer, struct dataset *ds) } } + /* It would be better to handle Z scores correctly (however we define + that) when TEMPORARY is in effect, but in the meantime this at least + prevents a use-after-free error. See bug #38786. */ + if (proc_make_temporary_transformations_permanent (ds)) + msg (SW, _("DESCRIPTIVES with Z scores ignores TEMPORARY. " + "Temporary transformations will be made permanent.")); + proto = caseproto_create (); for (i = 0; i < 1 + 2 * z_cnt; i++) proto = caseproto_add_width (proto, 0); @@ -434,7 +441,8 @@ cmd_descriptives (struct lexer *lexer, struct dataset *ds) dsc->vars[i].moments = moments_create (dsc->max_moment); /* Data pass. */ - grouper = casegrouper_create_splits (proc_open (ds), dict); + grouper = casegrouper_create_splits (proc_open_filtering (ds, z_cnt == 0), + dict); while (casegrouper_get_next_group (grouper, &group)) calc_descriptives (dsc, group, ds); ok = casegrouper_destroy (grouper);