i : index of Proto.upvalues
| 278 | |
| 279 | // i : index of Proto.upvalues |
| 280 | std::string getUpvalName(GluaDecompileContextP ctx, const Proto* f, int i) { |
| 281 | if (f->upvalues && i < f->sizeupvalues) { |
| 282 | // no need to test after FixUpvalNames |
| 283 | return getstr(UPVAL_NAME(f, i)); |
| 284 | } |
| 285 | else { |
| 286 | ctx->unknown_upvalue = std::string("ERROR_unknown_upvalue_") + std::to_string(i); |
| 287 | return ctx->unknown_upvalue; |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | #define UPVALUE(ctx, i) (getUpvalName(ctx, F->f,i)) |
| 292 | #define LOCAL(ctx, i) (getLocalName(ctx, F->f,i)) |
no test coverage detected