# HG changeset patch # User John W. Eaton # Date 1236892094 14400 # Node ID d1eab3ddb02d054b7e598f9cb520e2e69e82b67a # Parent 985792c9e0dad1de126058054e13b5fa102e9f86 oct-inttypes.h (bitshift): apply mask even if not shifting diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2009-03-12 John W. Eaton + + * oct-inttypes.h (bitshift): Apply mask even if not shifting. + From Seb Astien . + 2009-03-11 Jaroslav Hajek * PermMatrix.cc (PermMatrix::power): New method. diff --git a/liboctave/oct-inttypes.h b/liboctave/oct-inttypes.h --- a/liboctave/oct-inttypes.h +++ b/liboctave/oct-inttypes.h @@ -963,7 +963,7 @@ else if (n < 0) return (a >> -n) & mask; else - return a; + return a & mask; } typedef octave_int octave_int8;