diff options
author | Lua Team <team@lua.org> | 2010-11-16 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2010-11-16 12:00:00 +0000 |
commit | ccd28dfe034d5dfd130e5378a147e3e9fe7f6807 (patch) | |
tree | f1c922e8064f556c1034511afbbb3376640c4d27 /src/lbitlib.c | |
parent | d4bba06f4b8264eee00b25ee08e982d348486aaf (diff) | |
download | lua-github-5.2.0-alpha-rc1.tar.gz |
Lua 5.2.0-alpha-rc15.2.0-alpha-rc1
Diffstat (limited to 'src/lbitlib.c')
-rw-r--r-- | src/lbitlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lbitlib.c b/src/lbitlib.c index e93575e6..b37344f3 100644 --- a/src/lbitlib.c +++ b/src/lbitlib.c @@ -1,5 +1,5 @@ /* -** $Id: lbitlib.c,v 1.10 2010/10/28 15:17:29 roberto Exp $ +** $Id: lbitlib.c,v 1.11 2010/11/08 16:31:22 roberto Exp $ ** Standard library for bitwise operations ** See Copyright Notice in lua.h */ @@ -108,7 +108,7 @@ static int b_rshift (lua_State *L) { static int b_arshift (lua_State *L) { b_uint r = getuintarg(L, 1); int i = luaL_checkint(L, 2); - if (i < 0 || !(r & (1 << (NBITS - 1)))) + if (i < 0 || !(r & ((b_uint)1 << (NBITS - 1)))) return b_shift(L, r, -i); else { /* arithmetic shift for 'negative' number */ if (i >= NBITS) r = ALLONES; |