perl-module: Fix return value of append_case subroutine. 104/pspp 20101115030516/pspp
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 15 Nov 2010 06:13:37 +0000 (22:13 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 15 Nov 2010 06:17:22 +0000 (22:17 -0800)
The casewriter_write() function does not have a return value (it is
declared as "void"), but the append_case subroutine tried to use its
return value anyway.  This cannot work properly, of course, and in fact
caused problems on 64-bit builds in particular.

I don't know why there is no C compiler warning about this problem.  I
guess the Perl module build must somehow turn off a lot of GCC warnings.

Reported by bojo42 <bojo42@gmail.com> in bug #31611.

perl-module/PSPP.xs

index a95ccf63aef6336c070af3e09fe587076a15eb2d..25effb9216b77364c9641b0a479b397cd25dea37 100644 (file)
@@ -685,7 +685,8 @@ CODE:
    union value *val = case_data_rw (c, v);
    value_set_missing (val, var_get_width (v));
  }
- RETVAL = casewriter_write (sfi->writer, c);
+ casewriter_write (sfi->writer, c);
+ RETVAL = 1;
  finish:
  free (vv);
 OUTPUT: