| 1038 | } |
| 1039 | |
| 1040 | static int lua_common_compile(lua_State *L, lua_Reader reader, void *dt, |
| 1041 | const char *chunkname, const char *mode, lua_Writer writer, void *dest) |
| 1042 | { |
| 1043 | Proto *proto = getproto(L->top - 1); |
| 1044 | if (nullptr == dest) |
| 1045 | { |
| 1046 | perror("compile destination not found"); |
| 1047 | return LUA_ERRERR; |
| 1048 | } |
| 1049 | lua_lock(L); |
| 1050 | luaU_dump(L, proto, writer, dest, 0); |
| 1051 | lua_unlock(L); |
| 1052 | return LUA_OK; |
| 1053 | } |
| 1054 | |
| 1055 | /** |
| 1056 | * compile current lua state to binary |
no test coverage detected