Merge remote branch 'origin/master' into import-gui
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 1 Apr 2013 05:51:32 +0000 (07:51 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 1 Apr 2013 05:51:32 +0000 (07:51 +0200)
Conflicts:
src/data/casereader.c

1  2 
src/data/casereader.c

diff --combined src/data/casereader.c
index 37adbb37d605c1399051fc98a84e433e6b90d1ee,adb6b6a909b134e815836aa75cbf0b1263d79b68..423a4dada271b432bef5ce8397f4f771b09e909a
@@@ -1,4 -1,4 +1,4 @@@
 -/* PSPP - a program for statistical analysis.
 +/* pspp - a program for statistical analysis.
     Copyright (C) 2007, 2009, 2010, 2013 Free Software Foundation, Inc.
  
     This program is free software: you can redistribute it and/or modify
@@@ -239,12 -239,26 +239,25 @@@ static casenumbe
  casereader_count_cases__ (const struct casereader *reader,
                            casenumber max_cases)
  {
-   struct casereader *clone = casereader_clone (reader);
-   casenumber n_cases = casereader_advance (clone, max_cases);
+   struct casereader *clone;
+   casenumber n_cases;
+   /* This seems to avoid a bug in Gcc 4.4.5 where, upon
+      return from this function, the stack appeared corrupt,
+      and the program returned to the wrong address.  Oddly
+      the problem only manifested itself when used in conjunction
+      with the ODS reader, in code such as:
+      GET DATA /TYPE=ODS ....
+      LIST.
+   */
  #if (__GNUC__ == 4 ) && (__GNUC_MINOR__ == 4)
    volatile int x = 1; x++;
  #endif
+   clone = casereader_clone (reader);
+   n_cases = casereader_advance (clone, max_cases);
    casereader_destroy (clone);
 -
    return n_cases;
  }