INPUT PROGRAM: Use a separate dataset for the input program. 20130613010503/pspp 20130614010504/pspp 20130615010505/pspp 20130616010503/pspp
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 13 Jun 2013 07:03:51 +0000 (00:03 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 13 Jun 2013 07:07:13 +0000 (00:07 -0700)
commit3b07fccffef73bba4bb1839fced20554df75901e
treefecda64189e74310ed10aa477da1dd0023e56aa9
parenta352ef204364d7b21036777ea40d6fa6046bae5f
INPUT PROGRAM: Use a separate dataset for the input program.

Without this change, INPUT PROGRAM uses the same dataset as the following
syntax.  This usually is fine, but there's at least one case where it
doesn't work: if the INPUT PROGRAM defines a vector, then a following
proc_execute() without any intervening transformations causes
proc_execute() to follow a "fast path" where it skips running the procedure
but instead just does a few things, like clearing the set of vectors.
Unfortunately, this means that later when the input program is really run,
  it doesn't have the vectors and accesses freed memory.

This commit switches to a different tactic.  INPUT PROGRAM creates a
special session and dataset that are used only for the input program.  This
keeps the dataset and the transformations used for the input program
separate from those used after the input program.

Bug #39097.
Reported by John Darrington.
src/data/session.c
src/data/session.h
src/language/data-io/inpt-pgm.c
src/ui/gui/psppire-data-window.c
src/ui/terminal/main.c
tests/language/data-io/inpt-pgm.at