Bug 7712 - Stdio.Buffer()->add_int32(0xffffffff) does not work on 32-bit systems
: Stdio.Buffer()->add_int32(0xffffffff) does not work on 32-bit systems
Status: RESOLVED FIXED
: Pike
Modules
: 8.0
: All All
: P3 (normal) normal
: ---
Assigned To:
:
:
:
  Show dependency treegraph
 
Reported: 2016-06-09 16:31 CET by
Modified: 2016-06-09 18:12 CET (History)
Scrum Prio:
In scrum?: ---
Story included in sprints:
Unplanned in sprints:


Attachments


Description From 2016-06-09 16:31:21 CET
The add_int32() method of Stdio.Buffer is supposed to accept any
32-bit number, in the range 0-0xffffffff.  When Pike is compiled
on a 64-bit system this works.  But on a 32-bit i686 Debian 8 it fails:

Bad argument 1 to add_int32(). Expected int.
Unknown program: add_int32(4294967295)
-:1:
    _static_modules._Stdio()->Buffer(0 bytes, read=[..-1] data=[0..-1] free=[0
    ..224] allocated)->add_int32(4294967295)                                  
/home/minibuilder/buffer-fun.pike:6: /main()->main()


Test program:

#!/usr/bin/env pike8

int main()
{
  Stdio.Buffer buffer = Stdio.Buffer();
  buffer->add_int32(0xffffffff);
  werror("%O\n", buffer->read());
  return 0;
}

Tested with the current head of the 8.0 branch from the Git
repo.
------- Comment #1 From 2016-06-09 18:12:45 CET -------
Fixed the most common case.

Note

You need to log in before you can comment on or make changes to this bug.