gnumeric r16604 - in branches/gnumeric-1-8: . plugins/fn-stat
- From: mortenw svn gnome org
- To: svn-commits-list gnome org
- Subject: gnumeric r16604 - in branches/gnumeric-1-8: . plugins/fn-stat
- Date: Sat, 24 May 2008 17:44:55 +0000 (UTC)
Author: mortenw
Date: Sat May 24 17:44:54 2008
New Revision: 16604
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16604&view=rev
Log:
2008-05-24 Morten Welinder <terra gnome org>
* functions.c (gnumeric_trend): Fix error handling and don't
evaluate things twice. Fixes #534587.
Modified:
branches/gnumeric-1-8/NEWS
branches/gnumeric-1-8/plugins/fn-stat/ChangeLog
branches/gnumeric-1-8/plugins/fn-stat/functions.c
Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS (original)
+++ branches/gnumeric-1-8/NEWS Sat May 24 17:44:54 2008
@@ -42,6 +42,7 @@
* Fix RANDEXPPOW hang. [#533965]
* Fix array evaluation problem. [#533953]
* Fix COUNTBLANK crash. [#534204]
+ * Fix TREND crash. [#534587]
--------------------------------------------------------------------------
Gnumeric 1.8.2
Modified: branches/gnumeric-1-8/plugins/fn-stat/functions.c
==============================================================================
--- branches/gnumeric-1-8/plugins/fn-stat/functions.c (original)
+++ branches/gnumeric-1-8/plugins/fn-stat/functions.c Sat May 24 17:44:54 2008
@@ -4592,11 +4592,16 @@
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
&nx, &result);
+ if (result)
+ goto out;
nxs = collect_floats_value (argv[2], ei->pos,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
&nnx, &result);
+ if (result)
+ goto out;
+
if (argv[3] != NULL) {
affine = value_get_as_bool (argv[3], &err);
if (err) {
@@ -4605,28 +4610,28 @@
}
}
} else {
- /* @new_x's is assumed to be the same as @known_x's */
if (argv[1] != NULL) {
xs = collect_floats_value (argv[1], ei->pos,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
&nx, &result);
- nxs = collect_floats_value (argv[1], ei->pos,
- COLLECT_IGNORE_STRINGS |
- COLLECT_IGNORE_BOOLS,
- &nnx, &result);
+ if (result)
+ goto out;
} else {
xs = g_new (gnm_float, ny);
for (nx = 0; nx < ny; nx++)
xs[nx] = nx + 1;
- nxs = g_new (gnm_float, ny);
- for (nnx = 0; nnx < ny; nnx++)
- xs[nnx] = nnx + 1;
}
+
+ /* @new_x's is assumed to be the same as @known_x's */
+ nnx = nx;
+ nxs = g_memdup (xs, nnx * sizeof (*xs));
}
- if (result || ny < 1)
+ if (ny < 1 || nnx < 1) {
+ result = value_new_error_NUM (ei->pos);
goto out;
+ }
if (nx != ny) {
result = value_new_error_NUM (ei->pos);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]