+Fri Apr 29 09:28:00 WST 2005 John Darrington <john@darrington.wattle.id.au>
+
+ * expressions/parse.c: Added handler for OP_LAG_Vn and OP_LAG_Vs.
+ Fixed bug [#12858] .
+
Wed Apr 27 12:42:34 WST 2005 John Darrington <john@darrington.wattle.id.au>
* loop.c recode.c repeat.c: Fixed a couple of instances of SHORT_NAME_LEN
n = expr_allocate_composite (e, f - operations, args, arg_cnt);
n->composite.min_valid = min_valid != -1 ? min_valid : f->array_min_elems;
- if (n->type == OP_LAG_Vnn || n->type == OP_LAG_Vsn)
+ if (n->type == OP_LAG_Vn || n->type == OP_LAG_Vs)
+ n_lag = 1;
+ else if (n->type == OP_LAG_Vnn || n->type == OP_LAG_Vsn)
{
int n_before;
assert (n->composite.arg_cnt == 2);
struct ccase *
lagged_case (int n_before)
{
- assert (n_before >= 1 && n_before <= n_lag);
+ assert (n_before >= 1 );
+ assert (n_before <= n_lag);
+
if (n_before <= lag_count)
{
int index = lag_head - n_before;
bugs/get-no-file.sh \
bugs/html-frequency.sh \
bugs/if_crash.sh \
+ bugs/lag_crash.sh \
bugs/multipass.sh \
bugs/random.sh \
bugs/t-test-with-temp.sh \
--- /dev/null
+#!/bin/sh
+
+# This program tests for a bug which crashed pspp when using LAG
+
+TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+activity="create program"
+cat > $TESTFILE << EOF
+DATA LIST LIST /x.
+BEGIN DATA
+1
+2
+END DATA.
+
+DO IF (x <> LAG(x) ).
+ ECHO 'hello'.
+END IF.
+
+EXECUTE.
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="run_program"
+$SUPERVISOR $here/../src/pspp $TESTFILE > /dev/null
+if [ $? -ne 0 ] ; then fail ; fi
+
+
+pass;