| 212 | // 500M |
| 213 | const int g_lineslimit = 1024 * 1024 * 500; |
| 214 | static bool LoadDebug(LoadState *S, Proto *f) { |
| 215 | int i, n; |
| 216 | n = LoadInt(S); |
| 217 | if (n > g_lineslimit) |
| 218 | { |
| 219 | return false; |
| 220 | } |
| 221 | |
| 222 | f->lineinfo = luaM_newvector(S->L, n, int); |
| 223 | f->sizelineinfo = n; |
| 224 | LoadVector(S, f->lineinfo, n); |
| 225 | n = LoadInt(S); |
| 226 | f->locvars = luaM_newvector(S->L, n, LocVar); |
| 227 | f->sizelocvars = n; |
| 228 | for (i = 0; i < n; i++) |
| 229 | f->locvars[i].varname = nullptr; |
| 230 | for (i = 0; i < n; i++) { |
| 231 | f->locvars[i].varname = LoadString(S); |
| 232 | f->locvars[i].startpc = LoadInt(S); |
| 233 | f->locvars[i].endpc = LoadInt(S); |
| 234 | } |
| 235 | n = LoadInt(S); |
| 236 | for (i = 0; i < n; i++) |
| 237 | f->upvalues[i].name = LoadString(S); |
| 238 | |
| 239 | return true; |
| 240 | } |
| 241 | |
| 242 | |
| 243 | static void LoadFunction(LoadState *S, Proto *f, TString *psource) { |
no test coverage detected