MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / GetR

Function GetR

src/Chain/libraries/glua/glua_decompile.cpp:1286–1300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1284void DeclareVariable(GluaDecompileContextP ctx, Function* F, std::string name, int reg);
1285
1286std::string GetR(GluaDecompileContextP ctx, Function* F, int r) {
1287 if (IS_TABLE(r)) {
1288 PrintTable(ctx, F, r, 0);
1289 if (ctx->error.length()>0) return nullptr;
1290 }
1291 UnsetPending(ctx, F, r);
1292 if (ctx->error.length()>0) return nullptr;
1293
1294 if (F->R[r].length()<1) {
1295 char sb[] = { "R%rrrrr%_PC%pcccccccc%" };
1296 sprintf(sb, "R%d_PC%d", r, F->pc);
1297 DeclareVariable(ctx, F, sb, r);
1298 }//dirty hack , some numeric FOR loops may cause error
1299 return F->R[r];
1300}
1301
1302void DeclareVariable(GluaDecompileContextP ctx, Function* F, std::string name, int reg) {
1303 IS_VARIABLE(reg) = 1;

Callers 5

SetListFunction · 0.85
DeclareLocalsFunction · 0.85
RegisterOrConstantFunction · 0.85
DeclarePendingLocalsFunction · 0.85
ProcessCodeFunction · 0.85

Calls 4

UnsetPendingFunction · 0.85
DeclareVariableFunction · 0.85
PrintTableFunction · 0.70
lengthMethod · 0.45

Tested by

no test coverage detected