lvm.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. /*
  2. ** $Id: lvm.c,v 1.103 2000/04/14 17:45:25 roberto Exp roberto $
  3. ** Lua virtual machine
  4. ** See Copyright Notice in lua.h
  5. */
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #define LUA_REENTRANT
  10. #include "lauxlib.h"
  11. #include "ldebug.h"
  12. #include "ldo.h"
  13. #include "lfunc.h"
  14. #include "lgc.h"
  15. #include "lobject.h"
  16. #include "lopcodes.h"
  17. #include "lstate.h"
  18. #include "lstring.h"
  19. #include "ltable.h"
  20. #include "ltm.h"
  21. #include "lvm.h"
  22. #ifdef OLD_ANSI
  23. #define strcoll(a,b) strcmp(a,b)
  24. #endif
  25. /*
  26. ** Extra stack size to run a function:
  27. ** TAG_LINE(1), NAME(1), TM calls(3) (plus some extra...)
  28. */
  29. #define EXTRA_STACK 8
  30. int luaV_tonumber (TObject *obj) { /* LUA_NUMBER */
  31. if (ttype(obj) != TAG_STRING)
  32. return 1;
  33. else {
  34. if (!luaO_str2d(svalue(obj), &nvalue(obj)))
  35. return 2;
  36. ttype(obj) = TAG_NUMBER;
  37. return 0;
  38. }
  39. }
  40. int luaV_tostring (lua_State *L, TObject *obj) { /* LUA_NUMBER */
  41. if (ttype(obj) != TAG_NUMBER)
  42. return 1;
  43. else {
  44. char s[32]; /* 16 digits, sign, point and \0 (+ some extra...) */
  45. sprintf(s, "%.16g", (double)nvalue(obj));
  46. tsvalue(obj) = luaS_new(L, s);
  47. ttype(obj) = TAG_STRING;
  48. return 0;
  49. }
  50. }
  51. void luaV_setn (lua_State *L, Hash *t, int val) {
  52. TObject index, value;
  53. ttype(&index) = TAG_STRING; tsvalue(&index) = luaS_new(L, "n");
  54. ttype(&value) = TAG_NUMBER; nvalue(&value) = val;
  55. luaH_set(L, t, &index, &value);
  56. }
  57. static Closure *luaV_closure (lua_State *L, lua_Type t, int nelems) {
  58. Closure *c = luaF_newclosure(L, nelems);
  59. L->top -= nelems;
  60. while (nelems--)
  61. c->consts[nelems] = *(L->top+nelems);
  62. ttype(L->top) = t;
  63. clvalue(L->top) = c;
  64. incr_top;
  65. return c;
  66. }
  67. void luaV_Cclosure (lua_State *L, lua_CFunction c, int nelems) {
  68. Closure *cl = luaV_closure(L, TAG_CCLOSURE, nelems);
  69. cl->f.c = c;
  70. }
  71. void luaV_Lclosure (lua_State *L, Proto *l, int nelems) {
  72. Closure *cl = luaV_closure(L, TAG_LCLOSURE, nelems);
  73. cl->f.l = l;
  74. }
  75. /*
  76. ** Function to index a table.
  77. ** Receives the table at top-2 and the index at top-1.
  78. */
  79. void luaV_gettable (lua_State *L, StkId top) {
  80. TObject *table = top-2;
  81. const TObject *im;
  82. if (ttype(table) != TAG_TABLE) { /* not a table, get gettable TM */
  83. im = luaT_getimbyObj(L, table, IM_GETTABLE);
  84. if (ttype(im) == TAG_NIL) {
  85. L->top = top;
  86. luaG_indexerror(L, table);
  87. }
  88. }
  89. else { /* object is a table... */
  90. int tg = table->value.a->htag;
  91. im = luaT_getim(L, tg, IM_GETTABLE);
  92. if (ttype(im) == TAG_NIL) { /* and does not have a `gettable' TM */
  93. const TObject *h = luaH_get(L, avalue(table), table+1);
  94. if (ttype(h) == TAG_NIL &&
  95. (ttype(im=luaT_getim(L, tg, IM_INDEX)) != TAG_NIL)) {
  96. /* result is nil and there is an `index' tag method */
  97. L->top = top;
  98. luaD_callTM(L, im, 2, 1); /* calls it */
  99. }
  100. else
  101. *table = *h; /* `push' result into table position */
  102. return;
  103. }
  104. /* else it has a `gettable' TM, go through to next command */
  105. }
  106. /* object is not a table, or it has a `gettable' TM */
  107. L->top = top;
  108. luaD_callTM(L, im, 2, 1);
  109. }
  110. /*
  111. ** Receives table at *t, index at *(t+1) and value at `top'.
  112. */
  113. void luaV_settable (lua_State *L, StkId t, StkId top) {
  114. const TObject *im;
  115. if (ttype(t) != TAG_TABLE) { /* not a table, get `settable' method */
  116. L->top = top;
  117. im = luaT_getimbyObj(L, t, IM_SETTABLE);
  118. if (ttype(im) == TAG_NIL)
  119. luaG_indexerror(L, t);
  120. }
  121. else { /* object is a table... */
  122. im = luaT_getim(L, avalue(t)->htag, IM_SETTABLE);
  123. if (ttype(im) == TAG_NIL) { /* and does not have a `settable' method */
  124. luaH_set(L, avalue(t), t+1, top-1);
  125. return;
  126. }
  127. /* else it has a `settable' method, go through to next command */
  128. }
  129. /* object is not a table, or it has a `settable' method */
  130. /* prepare arguments and call the tag method */
  131. luaD_checkstack(L, 3);
  132. *(top+2) = *(top-1);
  133. *(top+1) = *(t+1);
  134. *(top) = *t;
  135. *(top-1) = *im;
  136. L->top = top+3;
  137. luaD_call(L, top-1, 0);
  138. }
  139. void luaV_rawsettable (lua_State *L, StkId t) {
  140. if (ttype(t) != TAG_TABLE)
  141. lua_error(L, "indexed expression not a table");
  142. else {
  143. luaH_set(L, avalue(t), t+1, L->top-1);
  144. L->top -= 3;
  145. }
  146. }
  147. void luaV_getglobal (lua_State *L, GlobalVar *gv, StkId top) {
  148. const TObject *value = &gv->value;
  149. TObject *im = luaT_getimbyObj(L, value, IM_GETGLOBAL);
  150. if (ttype(im) == TAG_NIL) /* is there a tag method? */
  151. *top = *value; /* default behavior */
  152. else { /* tag method */
  153. luaD_checkstack(L, 3);
  154. *top = *im;
  155. ttype(top+1) = TAG_STRING;
  156. tsvalue(top+1) = gv->name; /* global name */
  157. *(top+2) = *value;
  158. L->top = top+3;
  159. luaD_call(L, top, 1);
  160. }
  161. }
  162. void luaV_setglobal (lua_State *L, GlobalVar *gv, StkId top) {
  163. const TObject *oldvalue = &gv->value;
  164. const TObject *im = luaT_getimbyObj(L, oldvalue, IM_SETGLOBAL);
  165. if (ttype(im) == TAG_NIL) /* is there a tag method? */
  166. gv->value = *(top-1);
  167. else {
  168. luaD_checkstack(L, 3);
  169. *(top+2) = *(top-1); /* new value */
  170. *(top+1) = *oldvalue;
  171. ttype(top) = TAG_STRING;
  172. tsvalue(top) = gv->name;
  173. *(top-1) = *im;
  174. L->top = top+3;
  175. luaD_call(L, top-1, 0);
  176. }
  177. }
  178. static void call_binTM (lua_State *L, StkId top, IMS event, const char *msg) {
  179. /* try first operand */
  180. const TObject *im = luaT_getimbyObj(L, top-2, event);
  181. L->top = top;
  182. if (ttype(im) == TAG_NIL) {
  183. im = luaT_getimbyObj(L, top-1, event); /* try second operand */
  184. if (ttype(im) == TAG_NIL) {
  185. im = luaT_getim(L, 0, event); /* try a `global' method */
  186. if (ttype(im) == TAG_NIL)
  187. lua_error(L, msg);
  188. }
  189. }
  190. lua_pushstring(L, luaT_eventname[event]);
  191. luaD_callTM(L, im, 3, 1);
  192. }
  193. static void call_arith (lua_State *L, StkId top, IMS event) {
  194. call_binTM(L, top, event, "unexpected type in arithmetic operation");
  195. }
  196. static void addK (lua_State *L, StkId top, int k) {
  197. ttype(top) = TAG_NUMBER;
  198. nvalue(top) = (Number)k;
  199. call_arith(L, top+1, IM_ADD);
  200. }
  201. static int luaV_strcomp (const TString *ls, const TString *rs) {
  202. const char *l = ls->str;
  203. long ll = ls->u.s.len;
  204. const char *r = rs->str;
  205. long lr = rs->u.s.len;
  206. for (;;) {
  207. long temp = strcoll(l, r);
  208. if (temp != 0) return temp;
  209. /* strings are equal up to a '\0' */
  210. temp = strlen(l); /* index of first '\0' in both strings */
  211. if (temp == ll) /* l is finished? */
  212. return (temp == lr) ? 0 : -1; /* l is equal or smaller than r */
  213. else if (temp == lr) /* r is finished? */
  214. return 1; /* l is greater than r (because l is not finished) */
  215. /* both strings longer than temp; go on comparing (after the '\0') */
  216. temp++;
  217. l += temp; ll -= temp; r += temp; lr -= temp;
  218. }
  219. }
  220. int luaV_lessthan (lua_State *L, const TObject *l, const TObject *r, StkId top) {
  221. if (ttype(l) == TAG_NUMBER && ttype(r) == TAG_NUMBER)
  222. return (nvalue(l) < nvalue(r));
  223. else if (ttype(l) == TAG_STRING && ttype(r) == TAG_STRING)
  224. return (luaV_strcomp(tsvalue(l), tsvalue(r)) < 0);
  225. else { /* call TM */
  226. luaD_checkstack(L, 2);
  227. *top++ = *l;
  228. *top++ = *r;
  229. call_binTM(L, top, IM_LT, "unexpected type in comparison");
  230. L->top--;
  231. return (ttype(L->top) != TAG_NIL);
  232. }
  233. }
  234. static void strconc (lua_State *L, int total, StkId top) {
  235. do {
  236. int n = 2; /* number of elements handled in this pass (at least 2) */
  237. if (tostring(L, top-2) || tostring(L, top-1))
  238. call_binTM(L, top, IM_CONCAT, "unexpected type for concatenation");
  239. else if (tsvalue(top-1)->u.s.len > 0) { /* if len=0, do nothing */
  240. /* at least two string values; get as many as possible */
  241. long tl = tsvalue(top-1)->u.s.len + tsvalue(top-2)->u.s.len;
  242. char *buffer;
  243. int i;
  244. while (n < total && !tostring(L, top-n-1)) { /* collect total length */
  245. tl += tsvalue(top-n-1)->u.s.len;
  246. n++;
  247. }
  248. buffer = luaL_openspace(L, tl);
  249. tl = 0;
  250. for (i=n; i>0; i--) { /* concat all strings */
  251. long l = tsvalue(top-i)->u.s.len;
  252. memcpy(buffer+tl, tsvalue(top-i)->str, l);
  253. tl += l;
  254. }
  255. tsvalue(top-n) = luaS_newlstr(L, buffer, tl);
  256. }
  257. total -= n-1; /* got `n' strings to create 1 new */
  258. top -= n-1;
  259. } while (total > 1); /* repeat until only 1 result left */
  260. }
  261. void luaV_pack (lua_State *L, StkId firstelem, int nvararg, TObject *tab) {
  262. int i;
  263. Hash *htab;
  264. htab = avalue(tab) = luaH_new(L, nvararg+1); /* +1 for field `n' */
  265. ttype(tab) = TAG_TABLE;
  266. for (i=0; i<nvararg; i++)
  267. luaH_setint(L, htab, i+1, firstelem+i);
  268. luaV_setn(L, htab, nvararg); /* store counter in field `n' */
  269. }
  270. static void adjust_varargs (lua_State *L, StkId base, int nfixargs) {
  271. TObject arg;
  272. int nvararg = (L->top-base) - nfixargs;
  273. if (nvararg < 0) {
  274. luaV_pack(L, base, 0, &arg);
  275. luaD_adjusttop(L, base, nfixargs);
  276. }
  277. else {
  278. luaV_pack(L, base+nfixargs, nvararg, &arg);
  279. L->top = base+nfixargs;
  280. }
  281. *L->top++ = arg;
  282. }
  283. /*
  284. ** Executes the given Lua function. Parameters are between [base,top).
  285. ** Returns n such that the the results are between [n,top).
  286. */
  287. StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
  288. const Proto *tf = cl->f.l;
  289. StkId top; /* keep top local, for performance */
  290. const Instruction *pc = tf->code;
  291. TString **kstr = tf->kstr;
  292. luaD_checkstack(L, tf->maxstacksize+EXTRA_STACK);
  293. if (tf->is_vararg) { /* varargs? */
  294. adjust_varargs(L, base, tf->numparams);
  295. luaC_checkGC(L);
  296. }
  297. else
  298. luaD_adjusttop(L, base, tf->numparams);
  299. top = L->top;
  300. for (;;) {
  301. Instruction i = *pc++;
  302. switch (GET_OPCODE(i)) {
  303. case OP_END:
  304. return L->top; /* no results */
  305. case OP_RETURN:
  306. L->top = top;
  307. return base+GETARG_U(i);
  308. case OP_CALL:
  309. L->top = top;
  310. luaD_call(L, base+GETARG_A(i), GETARG_B(i));
  311. top = L->top;
  312. break;
  313. case OP_TAILCALL:
  314. L->top = top;
  315. luaD_call(L, base+GETARG_A(i), MULT_RET);
  316. return base+GETARG_B(i);
  317. case OP_PUSHNIL: {
  318. int n = GETARG_U(i);
  319. LUA_ASSERT(L, n>0, "invalid argument");
  320. do {
  321. ttype(top++) = TAG_NIL;
  322. } while (--n > 0);
  323. break;
  324. }
  325. case OP_POP:
  326. top -= GETARG_U(i);
  327. break;
  328. case OP_PUSHINT:
  329. ttype(top) = TAG_NUMBER;
  330. nvalue(top) = (Number)GETARG_S(i);
  331. top++;
  332. break;
  333. case OP_PUSHSTRING:
  334. ttype(top) = TAG_STRING;
  335. tsvalue(top) = kstr[GETARG_U(i)];
  336. top++;
  337. break;
  338. case OP_PUSHNUM:
  339. ttype(top) = TAG_NUMBER;
  340. nvalue(top) = tf->knum[GETARG_U(i)];
  341. top++;
  342. break;
  343. case OP_PUSHNEGNUM:
  344. ttype(top) = TAG_NUMBER;
  345. nvalue(top) = -tf->knum[GETARG_U(i)];
  346. top++;
  347. break;
  348. case OP_PUSHUPVALUE:
  349. *top++ = cl->consts[GETARG_U(i)];
  350. break;
  351. case OP_GETLOCAL:
  352. *top++ = *(base+GETARG_U(i));
  353. break;
  354. case OP_GETGLOBAL:
  355. luaV_getglobal(L, kstr[GETARG_U(i)]->u.s.gv, top);
  356. top++;
  357. break;
  358. case OP_GETTABLE:
  359. luaV_gettable(L, top);
  360. top--;
  361. break;
  362. case OP_GETDOTTED:
  363. ttype(top) = TAG_STRING;
  364. tsvalue(top++) = kstr[GETARG_U(i)];
  365. luaV_gettable(L, top);
  366. top--;
  367. break;
  368. case OP_GETINDEXED:
  369. *top++ = *(base+GETARG_U(i));
  370. luaV_gettable(L, top);
  371. top--;
  372. break;
  373. case OP_PUSHSELF: {
  374. TObject receiver;
  375. receiver = *(top-1);
  376. ttype(top) = TAG_STRING;
  377. tsvalue(top++) = kstr[GETARG_U(i)];
  378. luaV_gettable(L, top);
  379. *(top-1) = receiver;
  380. break;
  381. }
  382. case OP_CREATETABLE:
  383. L->top = top;
  384. luaC_checkGC(L);
  385. avalue(top) = luaH_new(L, GETARG_U(i));
  386. ttype(top) = TAG_TABLE;
  387. top++;
  388. break;
  389. case OP_SETLOCAL:
  390. *(base+GETARG_U(i)) = *(--top);
  391. break;
  392. case OP_SETGLOBAL:
  393. luaV_setglobal(L, kstr[GETARG_U(i)]->u.s.gv, top);
  394. top--;
  395. break;
  396. case OP_SETTABLE:
  397. luaV_settable(L, top-GETARG_A(i), top);
  398. top -= GETARG_B(i); /* pop values */
  399. break;
  400. case OP_SETLIST: {
  401. int aux = GETARG_A(i) * LFIELDS_PER_FLUSH;
  402. int n = GETARG_B(i)+1;
  403. Hash *arr = avalue(top-n-1);
  404. L->top = top-n; /* final value of `top' (in case of errors) */
  405. for (; n; n--)
  406. luaH_setint(L, arr, n+aux, --top);
  407. break;
  408. }
  409. case OP_SETMAP: {
  410. int n = GETARG_U(i);
  411. StkId finaltop = top-2*(n+1);
  412. Hash *arr = avalue(finaltop-1);
  413. L->top = finaltop; /* final value of `top' (in case of errors) */
  414. do {
  415. luaH_set(L, arr, top-2, top-1);
  416. top-=2;
  417. } while (n--);
  418. break;
  419. }
  420. case OP_ADD:
  421. if (tonumber(top-1) || tonumber(top-2))
  422. call_arith(L, top, IM_ADD);
  423. else
  424. nvalue(top-2) += nvalue(top-1);
  425. top--;
  426. break;
  427. case OP_ADDI:
  428. if (tonumber(top-1))
  429. addK(L, top, GETARG_S(i));
  430. else
  431. nvalue(top-1) += (Number)GETARG_S(i);
  432. break;
  433. case OP_SUB:
  434. if (tonumber(top-1) || tonumber(top-2))
  435. call_arith(L, top, IM_SUB);
  436. else
  437. nvalue(top-2) -= nvalue(top-1);
  438. top--;
  439. break;
  440. case OP_MULT:
  441. if (tonumber(top-1) || tonumber(top-2))
  442. call_arith(L, top, IM_MUL);
  443. else
  444. nvalue(top-2) *= nvalue(top-1);
  445. top--;
  446. break;
  447. case OP_DIV:
  448. if (tonumber(top-1) || tonumber(top-2))
  449. call_arith(L, top, IM_DIV);
  450. else
  451. nvalue(top-2) /= nvalue(top-1);
  452. top--;
  453. break;
  454. case OP_POW:
  455. call_binTM(L, top, IM_POW, "undefined operation");
  456. top--;
  457. break;
  458. case OP_CONCAT: {
  459. int n = GETARG_U(i);
  460. strconc(L, n, top);
  461. top -= n-1;
  462. L->top = top;
  463. luaC_checkGC(L);
  464. break;
  465. }
  466. case OP_MINUS:
  467. if (tonumber(top-1)) {
  468. ttype(top) = TAG_NIL;
  469. call_arith(L, top+1, IM_UNM);
  470. }
  471. else
  472. nvalue(top-1) = -nvalue(top-1);
  473. break;
  474. case OP_NOT:
  475. ttype(top-1) =
  476. (ttype(top-1) == TAG_NIL) ? TAG_NUMBER : TAG_NIL;
  477. nvalue(top-1) = 1;
  478. break;
  479. case OP_JMPNE:
  480. top -= 2;
  481. if (!luaO_equalObj(top, top+1)) pc += GETARG_S(i);
  482. break;
  483. case OP_JMPEQ:
  484. top -= 2;
  485. if (luaO_equalObj(top, top+1)) pc += GETARG_S(i);
  486. break;
  487. case OP_JMPLT:
  488. top -= 2;
  489. if (luaV_lessthan(L, top, top+1, top+2)) pc += GETARG_S(i);
  490. break;
  491. case OP_JMPLE: /* a <= b === !(b<a) */
  492. top -= 2;
  493. if (!luaV_lessthan(L, top+1, top, top+2)) pc += GETARG_S(i);
  494. break;
  495. case OP_JMPGT: /* a > b === (b<a) */
  496. top -= 2;
  497. if (luaV_lessthan(L, top+1, top, top+2)) pc += GETARG_S(i);
  498. break;
  499. case OP_JMPGE: /* a >= b === !(a<b) */
  500. top -= 2;
  501. if (!luaV_lessthan(L, top, top+1, top+2)) pc += GETARG_S(i);
  502. break;
  503. case OP_JMPT:
  504. if (ttype(--top) != TAG_NIL) pc += GETARG_S(i);
  505. break;
  506. case OP_JMPF:
  507. if (ttype(--top) == TAG_NIL) pc += GETARG_S(i);
  508. break;
  509. case OP_JMPONT:
  510. if (ttype(top-1) != TAG_NIL) pc += GETARG_S(i);
  511. else top--;
  512. break;
  513. case OP_JMPONF:
  514. if (ttype(top-1) == TAG_NIL) pc += GETARG_S(i);
  515. else top--;
  516. break;
  517. case OP_JMP:
  518. pc += GETARG_S(i);
  519. break;
  520. case OP_PUSHNILJMP:
  521. ttype(top++) = TAG_NIL;
  522. pc++;
  523. break;
  524. case OP_FORPREP:
  525. if (tonumber(top-1))
  526. lua_error(L, "`for' step must be a number");
  527. if (tonumber(top-2))
  528. lua_error(L, "`for' limit must be a number");
  529. if (tonumber(top-3))
  530. lua_error(L, "`for' initial value must be a number");
  531. nvalue(top-3) -= nvalue(top-1); /* to be undone by first FORLOOP */
  532. pc += GETARG_S(i);
  533. break;
  534. case OP_FORLOOP: {
  535. Number step = nvalue(top-1);
  536. Number limit = nvalue(top-2);
  537. Number index;
  538. LUA_ASSERT(L, ttype(top-1) == TAG_NUMBER, "invalid step");
  539. LUA_ASSERT(L, ttype(top-2) == TAG_NUMBER, "invalid limit");
  540. if (ttype(top-3) != TAG_NUMBER)
  541. lua_error(L, "`for' index must be a number");
  542. index = nvalue(top-3)+step;
  543. if ((step>0) ? index<=limit : index>=limit) {
  544. nvalue(top-3) = index;
  545. pc += GETARG_S(i);
  546. }
  547. else /* end of `for': remove control variables */
  548. top -= 3;
  549. break;
  550. }
  551. case OP_CLOSURE:
  552. L->top = top;
  553. luaV_Lclosure(L, tf->kproto[GETARG_A(i)], GETARG_B(i));
  554. top = L->top;
  555. luaC_checkGC(L);
  556. break;
  557. case OP_SETLINE:
  558. if ((base-1)->ttype != TAG_LINE) {
  559. /* open space for LINE value */
  560. int n = top-base;
  561. while (n--) base[n+1] = base[n];
  562. base++;
  563. top++;
  564. (base-1)->ttype = TAG_LINE;
  565. }
  566. (base-1)->value.i = GETARG_U(i);
  567. if (L->linehook) {
  568. L->top = top;
  569. luaD_lineHook(L, base-2, GETARG_U(i));
  570. }
  571. break;
  572. }
  573. }
  574. }