diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-01-23 20:19:51 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-01-23 20:19:51 -0800 |
commit | ea68a3bfa64a5e652ee45227d7aff1aba73c001b (patch) | |
tree | e45a61cce808a4c70eb49e20d7d597c66fb52da2 /mpi | |
parent | f4052d2d430083cee285c9cdb9ff8f67dab852ae (diff) | |
download | txr-ea68a3bfa64a5e652ee45227d7aff1aba73c001b.tar.gz txr-ea68a3bfa64a5e652ee45227d7aff1aba73c001b.tar.bz2 txr-ea68a3bfa64a5e652ee45227d7aff1aba73c001b.zip |
ffi: almost bug: 64 bit signed big/little endian type.
* ffi.c (ffi_be_i64_get, ffi_le_i64_get): The code here for 32
bit platforms is fishy: it is using the signed cnum type for
the low 32 bits, when that should be ucnum. We are actually
okay because ths code would only be executed on a platform
where cnum is 32 bits. We are saved by the fact that we are
doing left shifts (no sign extension), that shifting a 1 into
a sign bit is harmless on two's complement machines, and that
the lo32 value is ultimately passed to unum whereby it is
coerced to a ucnum argument type (which preserves the bit
representation) and prevents logior from seeing a negative
value.
Diffstat (limited to 'mpi')
0 files changed, 0 insertions, 0 deletions