| 1226 | */ |
| 1227 | |
| 1228 | Function* 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 | |
| 1258 | void DeleteFunction(Function* self) { |
| 1259 | int i; |
no test coverage detected