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

Function SetList

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

Source from the content-addressed store, hash-verified

1125}
1126
1127void SetList(GluaDecompileContextP ctx, Function* F, int a, int b, int c) {
1128 int i;
1129 DecTable* tbl = (DecTable*)FindFromListTail(&(F->tables), (ListItemCmpFn)MatchTable, &a);
1130 if (!tbl) {
1131 ctx->errortmp = std::string("No list found for R") + std::to_string(a) + " , SetList fails";
1132 SET_ERROR(ctx, F, ctx->errortmp);
1133 return;
1134 }
1135 if (b == 0) {
1136 std::string rstr;
1137 i = 1;
1138 while (1) {
1139 rstr = GetR(ctx, F, a + i);
1140 if (ctx->error.length()>0)
1141 return;
1142 if (strcmp(rstr.c_str(), ".end") == 0)
1143 break;
1144 AddToTable(F, tbl, rstr, nullptr); // Lua5.1 specific TODO: it's not really this :(
1145 i++;
1146 };
1147 } //should be {...} or func(func()) ,when b == 0, that will use all avaliable reg from R(a)
1148
1149 for (i = 1; i <= b; i++) {
1150 auto rstr = GetR(ctx, F, a + i);
1151 if (ctx->error.length()>0)
1152 return;
1153 AddToTable(F, tbl, rstr, nullptr); // Lua5.1 specific TODO: it's not really this :(
1154 }
1155}
1156
1157void UnsetPending(GluaDecompileContextP ctx, Function* F, int r) {
1158 if (!IS_VARIABLE(r)) {

Callers 1

ProcessCodeFunction · 0.85

Calls 7

FindFromListTailFunction · 0.85
GetRFunction · 0.85
AddToTableFunction · 0.85
stringClass · 0.50
to_stringFunction · 0.50
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected