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

Function NewFunction

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

Source from the content-addressed store, hash-verified

1226*/
1227
1228Function* NewFunction(const Proto* f) {
1229 auto self = new Function();
1230 self->f = f;
1231 memset(&(self->tables), 0x0, sizeof(List));
1232 InitList(&(self->vpend));
1233 self->tpend = NewIntSet(0);
1234
1235 self->loop_tree = NewLoopItem(FUNCTION_STMT, -1, 0, 0, f->sizecode - 1, f->sizecode);
1236 self->loop_ptr = self->loop_tree;
1237
1238 self->funcBlock = self->loop_tree->block;
1239 self->currStmt = self->funcBlock;
1240
1241 self->loop_tree->block = self->funcBlock;
1242
1243 InitList(&(self->breaks));
1244 InitList(&(self->continues));
1245 InitList(&(self->jmpdests));
1246
1247 self->do_opens = NewIntSet(0);
1248 self->do_closes = NewIntSet(0);
1249 clear_sstream(self->decompiledCode);
1250
1251 InitList(&(self->bools));
1252
1253 self->funcnumstr = "";
1254
1255 return self;
1256}
1257
1258void DeleteFunction(Function* self) {
1259 int i;

Callers 1

ProcessCodeFunction · 0.85

Calls 4

InitListFunction · 0.85
NewIntSetFunction · 0.85
NewLoopItemFunction · 0.85
clear_sstreamFunction · 0.70

Tested by

no test coverage detected