| 535 | } |
| 536 | |
| 537 | LUA_API int lua_getstack(lua_State *L, int level, lua_Debug *ar) |
| 538 | { |
| 539 | int size; |
| 540 | cTValue *frame = lj_debug_frame(L, level, &size); |
| 541 | if (frame) { |
| 542 | ar->i_ci = (size << 16) + (int)(frame - tvref(L->stack)); |
| 543 | return 1; |
| 544 | } else { |
| 545 | ar->i_ci = level - size; |
| 546 | return 0; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | #if LJ_HASPROFILE |
| 551 | /* Put the chunkname into a buffer. */ |
no test coverage detected