mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
(PHP) fixes getting indirect table, also fixes getInt method on 32bit machine.
This commit is contained in:
@@ -399,8 +399,13 @@ class ByteBuffer
|
||||
$sign = $index + (ByteBuffer::isLittleEndian() ? 3 : 0);
|
||||
$issigned = isset($this->_buffer[$sign]) && ord($this->_buffer[$sign]) & 0x80;
|
||||
|
||||
// 4294967296 = 1 << 32 = Maximum unsigned 32-bit int
|
||||
return $issigned ? $result - 4294967296 : $result;
|
||||
if (PHP_INT_SIZE > 4) {
|
||||
// 4294967296 = 1 << 32 = Maximum unsigned 32-bit int
|
||||
return $issigned ? $result - 4294967296 : $result;
|
||||
} else {
|
||||
// 32bit / Windows treated number as signed integer.
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user