mirror of https://github.com/rusefi/lua.git
Details
Added documentation and asserts that constants for arithmetic opcodes must be numbers.
This commit is contained in:
parent
59c88f846d
commit
31925e4cc2
14
lopcodes.h
14
lopcodes.h
|
@ -225,13 +225,13 @@ OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][RK(C):string] */
|
|||
|
||||
OP_ADDI,/* A B sC R[A] := R[B] + sC */
|
||||
|
||||
OP_ADDK,/* A B C R[A] := R[B] + K[C] */
|
||||
OP_SUBK,/* A B C R[A] := R[B] - K[C] */
|
||||
OP_MULK,/* A B C R[A] := R[B] * K[C] */
|
||||
OP_MODK,/* A B C R[A] := R[B] % K[C] */
|
||||
OP_POWK,/* A B C R[A] := R[B] ^ K[C] */
|
||||
OP_DIVK,/* A B C R[A] := R[B] / K[C] */
|
||||
OP_IDIVK,/* A B C R[A] := R[B] // K[C] */
|
||||
OP_ADDK,/* A B C R[A] := R[B] + K[C]:number */
|
||||
OP_SUBK,/* A B C R[A] := R[B] - K[C]:number */
|
||||
OP_MULK,/* A B C R[A] := R[B] * K[C]:number */
|
||||
OP_MODK,/* A B C R[A] := R[B] % K[C]:number */
|
||||
OP_POWK,/* A B C R[A] := R[B] ^ K[C]:number */
|
||||
OP_DIVK,/* A B C R[A] := R[B] / K[C]:number */
|
||||
OP_IDIVK,/* A B C R[A] := R[B] // K[C]:number */
|
||||
|
||||
OP_BANDK,/* A B C R[A] := R[B] & K[C]:integer */
|
||||
OP_BORK,/* A B C R[A] := R[B] | K[C]:integer */
|
||||
|
|
4
lvm.c
4
lvm.c
|
@ -921,7 +921,7 @@ void luaV_finishOp (lua_State *L) {
|
|||
*/
|
||||
#define op_arithfK(L,fop) { \
|
||||
TValue *v1 = vRB(i); \
|
||||
TValue *v2 = KC(i); \
|
||||
TValue *v2 = KC(i); lua_assert(ttisnumber(v2)); \
|
||||
op_arithf_aux(L, v1, v2, fop); }
|
||||
|
||||
|
||||
|
@ -950,7 +950,7 @@ void luaV_finishOp (lua_State *L) {
|
|||
*/
|
||||
#define op_arithK(L,iop,fop) { \
|
||||
TValue *v1 = vRB(i); \
|
||||
TValue *v2 = KC(i); \
|
||||
TValue *v2 = KC(i); lua_assert(ttisnumber(v2)); \
|
||||
op_arith_aux(L, v1, v2, iop, fop); }
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue