i : index of Proto.locvars, not reg number
| 266 | |
| 267 | // i : index of Proto.locvars, not reg number |
| 268 | std::string getLocalName(GluaDecompileContextP ctx, const Proto* f, int i) { |
| 269 | if (f->locvars && i < f->sizelocvars) { |
| 270 | // no need to test after FixLocalNames |
| 271 | return getstr(f->locvars[i].varname); |
| 272 | } |
| 273 | else { |
| 274 | ctx->unknown_local = std::string("ERROR_unknown_local_") + std::to_string(i); |
| 275 | return ctx->unknown_local; |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | // i : index of Proto.upvalues |
| 280 | std::string getUpvalName(GluaDecompileContextP ctx, const Proto* f, int i) { |
no test coverage detected