Ran
|
Jobs
1
|
Files
89
|
Run time
5s
|
Badge
README BADGES
|
push
github
Restore cur_L for specific Lua/C API use case. Thanks to Peter Cawley. (cherry-picked from commit e86990f7f) Consider the following Lua C API function: ``` static int error_after_coroutine_return(lua_State *L) { lua_State *innerL = lua_newthread(L); luaL_loadstring(innerL, "print('inner coro')"); lua_pcall(innerL, 0, 0, 0); luaL_error(L, "my fancy error"); return 0; } ``` And the following Lua script: ``` local libcur_L = require('libcur_L') local function onesnap_f(var) if var then return 1 else return 0 end end -- Compile function to trace with snapshot. if jit then jit.opt.start('hotloop=1') end onesnap_f(true) onesnap_f(true) local r, s = pcall(libcur_L.error_after_coroutine_return) onesnap_f(false) ``` This is the only case when `cur_L` is not restored, according to the analysis done in lj-1066. This patch changes the error-catching routine, so now the patch sets the actual cur_L there. Now it is possible to throw errors on non-executing coroutines, which is a violation of the Lua C API. So, even though it is now possible, that behavior should be avoided anyway. Maxim Kokryashkin: * added the description and the test for the problem Resolves tarantool/tarantool#6323
5337 of 5972 branches covered (0.0%)
Branch coverage included in aggregate %.
4 of 4 new or added lines in 1 file covered. (100.0%)
20483 of 23296 relevant lines covered (87.92%)
2747685.43 hits per line
Lines | Coverage | ∆ | File |
---|---|---|---|
1 |
75.85 |
-0.08% | src/lj_opt_fold.c |
1 |
92.11 |
-2.63% | src/lj_vmmath.c |
2 |
92.76 |
-0.99% | src/lj_ir.c |
26 |
89.38 |
0.0% | src/lj_err.c |
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 6405294870.1 | 89 |
88.22 |
GitHub Action Run |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|---|---|---|---|---|---|---|---|---|
13.79 | src/lj_utils_leb128.c | 132 | 51 | 7 | 44 | 1545437.0 + 17935 | 1 | 6 | |
61.83 | src/lj_cparse.c | 1935 | 1029 | 635 | 394 | 186979.0 + 19754 | 183 | 111 | |
61.83 | src/lj_clib.c | 431 | 101 | 65 | 36 | 2736.0 | 16 | 14 | |
64.75 | src/lj_cconv.c | 763 | 387 | 238 | 149 | 517504.0 + 52481 | 89 | 29 | |
70.38 | src/lj_carith.c | 429 | 252 | 175 | 77 | 557411.0 + 57956 | 65 | 24 | |
72.56 | src/lj_crecord.c | 1912 | 927 | 654 | 273 | 64.0 - 1.0 | 208 | 53 | |
72.86 | src/lj_strscan.c | 537 | 261 | 188 | 73 | 2853680.0 + 1363 | 102 | 35 | |
73.0 | src/lj_api.c | 1368 | 859 | 622 | 237 | 963961.0 + 828 | 173 | 57 | |
75.0 | src/lib_ffi.c | 866 | 518 | 387 | 131 | 85597.0 + 8601 | 99 | 31 | |
75.85 | src/lj_opt_fold.c | 2522 | 971 | 721 - 1 | 250 + 1 | 22346.0 - 114 | 237 | 55 |