changeset 8963:d1eab3ddb02d

oct-inttypes.h (bitshift): apply mask even if not shifting
author John W. Eaton <jwe@octave.org>
date Thu, 12 Mar 2009 17:08:14 -0400
parents 985792c9e0da
children f4f4d65faaa0
files liboctave/ChangeLog liboctave/oct-inttypes.h
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-12  John W. Eaton  <jwe@octave.org>
+
+	* oct-inttypes.h (bitshift): Apply mask even if not shifting.
+	From Seb Astien <se6astien2@googlemail.com>.
+
 2009-03-11  Jaroslav Hajek  <highegg@gmail.com>
 
 	* PermMatrix.cc (PermMatrix::power): New method.
--- 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<int8_t> octave_int8;