diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-15 16:35:22 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-15 16:35:22 -0200 |
commit | 4b6928e7f524e2c2740fc1f9d16e130e0e2f4172 (patch) | |
tree | b19da6732285d1b022e073950e1fc6906755857b /lopcodes.h | |
parent | b3f924bc695ed6ebe2539d365197696e41863a91 (diff) | |
download | lua-4b6928e7f524e2c2740fc1f9d16e130e0e2f4172.tar.gz lua-4b6928e7f524e2c2740fc1f9d16e130e0e2f4172.tar.bz2 lua-4b6928e7f524e2c2740fc1f9d16e130e0e2f4172.zip |
(1 << 31) with signed integer has undefined behavior in C
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.176 2017/12/04 17:41:30 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.177 2017/12/13 18:32:09 roberto Exp roberto $ |
3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -121,7 +121,7 @@ enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */ | |||
121 | #define GETARG_sC(i) (GETARG_C(i) - MAXARG_sC) | 121 | #define GETARG_sC(i) (GETARG_C(i) - MAXARG_sC) |
122 | #define SETARG_C(i,v) setarg(i, v, POS_C, SIZE_C) | 122 | #define SETARG_C(i,v) setarg(i, v, POS_C, SIZE_C) |
123 | 123 | ||
124 | #define TESTARG_k(i) (cast(int, ((i) & (1 << POS_k)))) | 124 | #define TESTARG_k(i) (cast(int, ((i) & (1u << POS_k)))) |
125 | #define GETARG_k(i) getarg(i, POS_k, 1) | 125 | #define GETARG_k(i) getarg(i, POS_k, 1) |
126 | #define SETARG_k(i,v) setarg(i, v, POS_k, 1) | 126 | #define SETARG_k(i,v) setarg(i, v, POS_k, 1) |
127 | 127 | ||