diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-24 11:30:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-24 11:30:46 -0300 |
commit | 31925e4cc20018b2cf46664febd6347ce4a4b766 (patch) | |
tree | 159667853fbe827acdce92923fa34d401b1a89ec /lvm.c | |
parent | 59c88f846d1dcd901a4420651aedf27816618923 (diff) | |
download | lua-31925e4cc20018b2cf46664febd6347ce4a4b766.tar.gz lua-31925e4cc20018b2cf46664febd6347ce4a4b766.tar.bz2 lua-31925e4cc20018b2cf46664febd6347ce4a4b766.zip |
Details
Added documentation and asserts that constants for arithmetic opcodes
must be numbers.
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -921,7 +921,7 @@ void luaV_finishOp (lua_State *L) { | |||
921 | */ | 921 | */ |
922 | #define op_arithfK(L,fop) { \ | 922 | #define op_arithfK(L,fop) { \ |
923 | TValue *v1 = vRB(i); \ | 923 | TValue *v1 = vRB(i); \ |
924 | TValue *v2 = KC(i); \ | 924 | TValue *v2 = KC(i); lua_assert(ttisnumber(v2)); \ |
925 | op_arithf_aux(L, v1, v2, fop); } | 925 | op_arithf_aux(L, v1, v2, fop); } |
926 | 926 | ||
927 | 927 | ||
@@ -950,7 +950,7 @@ void luaV_finishOp (lua_State *L) { | |||
950 | */ | 950 | */ |
951 | #define op_arithK(L,iop,fop) { \ | 951 | #define op_arithK(L,iop,fop) { \ |
952 | TValue *v1 = vRB(i); \ | 952 | TValue *v1 = vRB(i); \ |
953 | TValue *v2 = KC(i); \ | 953 | TValue *v2 = KC(i); lua_assert(ttisnumber(v2)); \ |
954 | op_arith_aux(L, v1, v2, iop, fop); } | 954 | op_arith_aux(L, v1, v2, iop, fop); } |
955 | 955 | ||
956 | 956 | ||