diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-27 15:44:31 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-27 15:44:31 -0200 |
| commit | 093c16b67b263e334600ed306310b9015f65fa8b (patch) | |
| tree | 5ed17cb52078eddcc9b6b051e102839194ad4ba8 /ltm.c | |
| parent | 599f1742c628db70ef84794b3b8b25fdef9e5004 (diff) | |
| download | lua-093c16b67b263e334600ed306310b9015f65fa8b.tar.gz lua-093c16b67b263e334600ed306310b9015f65fa8b.tar.bz2 lua-093c16b67b263e334600ed306310b9015f65fa8b.zip | |
new opcodes 'OP_LTI' and 'OP_LEI'
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 16 |
1 files changed, 15 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 2.48 2017/11/08 14:50:23 roberto Exp $ | 2 | ** $Id: ltm.c,v 2.49 2017/11/23 19:18:10 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -196,6 +196,20 @@ int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, | |||
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | 198 | ||
| 199 | int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, | ||
| 200 | int inv, TMS event) { | ||
| 201 | TValue aux; const TValue *p2; | ||
| 202 | setivalue(&aux, v2); | ||
| 203 | if (inv) { /* arguments were exchanged? */ | ||
| 204 | p2 = p1; p1 = &aux; /* correct them */ | ||
| 205 | event = (event == TM_LE) ? TM_LT : TM_LE; | ||
| 206 | } | ||
| 207 | else | ||
| 208 | p2 = &aux; | ||
| 209 | return (luaT_callorderTM(L, p1, p2, event) != inv); | ||
| 210 | } | ||
| 211 | |||
| 212 | |||
| 199 | void luaT_adjustvarargs (lua_State *L, Proto *p, int actual) { | 213 | void luaT_adjustvarargs (lua_State *L, Proto *p, int actual) { |
| 200 | int i; | 214 | int i; |
| 201 | Table *vtab; | 215 | Table *vtab; |
