if(cls->static_constructor)
dump_method(fo, prefix2,"staticconstructor", "", cls->static_constructor, file);
- traits_dump(fo, prefix2, cls->static_traits, file);
+ traits_dump(fo, prefix2, cls->static_constructor_traits, file);
char*n = multiname_tostring(cls->classname);
if(cls->constructor)
free(n);
traits_dump(fo, prefix2,cls->traits, file);
fprintf(fo, "%s}\n", prefix);
-
}
fprintf(fo, "%s\n", prefix);
int s;
c->exceptions = list_new();
for(s=0;s<exception_count;s++) {
- abc_exception_t*e = malloc(sizeof(abc_exception_t));
+ exception_t*e = malloc(sizeof(exception_t));
e->from = code_atposition(codelookup, swf_GetU30(tag));
e->to = code_atposition(codelookup, swf_GetU30(tag));
abc_class_t*cls = (abc_class_t*)array_getvalue(file->classes, t);
/* SKIP */
swf_GetU30(tag); // cindex
- cls->static_traits = traits_parse(tag, pool, file);
+ cls->static_constructor_traits = traits_parse(tag, pool, file);
}
int num_scripts2 = swf_GetU30(tag);
for(t=0;t<num_scripts2;t++) {
} else {
swf_SetU30(tag, c->static_constructor->index);
}
- traits_write(pool, tag, c->static_traits);
+ traits_write(pool, tag, c->static_constructor_traits);
}
swf_SetU30(tag, file->scripts->num);
code_write(tag, c->code, pool, file);
swf_SetU30(tag, list_length(c->exceptions));
- abc_exception_list_t*l = c->exceptions;
+ exception_list_t*l = c->exceptions;
while(l) {
// warning: assumes "pos" in each code_t is up-to-date
swf_SetU30(tag, l->exception->from->pos);
void abc_file_free(abc_file_t*file)
{
int t;
- if(file->metadata) {
- for(t=0;t<file->metadata->num;t++) {
- array_t*items = (array_t*)array_getvalue(file->metadata, t);
- int s;
- for(s=0;s<items->num;s++) {
- free(array_getvalue(items, s));
- }
- array_free(items);
+ for(t=0;t<file->metadata->num;t++) {
+ array_t*items = (array_t*)array_getvalue(file->metadata, t);
+ int s;
+ for(s=0;s<items->num;s++) {
+ free(array_getvalue(items, s));
}
- array_free(file->metadata);file->metadata=0;
+ array_free(items);
}
+ array_free(file->metadata);
for(t=0;t<file->methods->num;t++) {
abc_method_t*m = (abc_method_t*)array_getvalue(file->methods, t);
}
free(m);
}
- array_free(file->methods);file->methods=0;
+ array_free(file->methods);
for(t=0;t<file->classes->num;t++) {
abc_class_t*cls = (abc_class_t*)array_getvalue(file->classes, t);
traits_free(cls->traits);cls->traits=0;
- traits_free(cls->static_traits);cls->static_traits=0;
+ traits_free(cls->static_constructor_traits);cls->static_constructor_traits=0;
if(cls->classname) {
multiname_destroy(cls->classname);
}
free(cls);
}
- array_free(file->classes);file->classes=0;
+ array_free(file->classes);
for(t=0;t<file->scripts->num;t++) {
abc_script_t*s = (abc_script_t*)array_getvalue(file->scripts, t);
traits_free(s->traits);s->traits=0;
free(s);
}
- array_free(file->scripts);file->scripts=0;
+ array_free(file->scripts);
for(t=0;t<file->method_bodies->num;t++) {
abc_method_body_t*body = (abc_method_body_t*)array_getvalue(file->method_bodies, t);
code_free(body->code);body->code=0;
traits_free(body->traits);body->traits=0;
- abc_exception_list_t*ee = body->exceptions;
+ exception_list_t*ee = body->exceptions;
while(ee) {
- abc_exception_t*e=ee->exception;ee->exception=0;
+ exception_t*e=ee->exception;ee->exception=0;
e->from = e->to = e->target = 0;
multiname_destroy(e->exc_type);e->exc_type=0;
multiname_destroy(e->var_name);e->var_name=0;
free(body);
}
- array_free(file->method_bodies);file->method_bodies=0;
+ array_free(file->method_bodies);
if(file->name) {
free((void*)file->name);file->name=0;