X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fabc.c;h=60ad6e7a4ee701d037088a1d1e14c6a0bc23af0c;hb=2d8bff0d979c62244081e0e98333c46afeedd770;hp=43753000c42f973f92e8553656d6b3a763fb0765;hpb=3e3788c55ee5a26eb9973274c3c5ad9bb7495b4d;p=swftools.git diff --git a/lib/as3/abc.c b/lib/as3/abc.c index 4375300..60ad6e7 100644 --- a/lib/as3/abc.c +++ b/lib/as3/abc.c @@ -157,10 +157,9 @@ void abc_class_add_interface(abc_class_t*c, multiname_t*interface) list_append(c->interfaces, multiname_clone(interface)); } -abc_method_t* abc_method_new(abc_file_t*file, multiname_t*returntype, char body) +void abc_method_init(abc_method_t*m, abc_file_t*file, multiname_t*returntype, char body) { /* construct method object */ - NEW(abc_method_t,m); m->index = array_length(file->methods); array_append(file->methods, NO_KEY, m); m->return_type = returntype; @@ -178,7 +177,11 @@ abc_method_t* abc_method_new(abc_file_t*file, multiname_t*returntype, char body) m->body = c; c->method = m; } - +} +abc_method_t* abc_method_new(abc_file_t*file, multiname_t*returntype, char body) +{ + NEW(abc_method_t,m); + abc_method_init(m, file, returntype, body); return m; } @@ -930,6 +933,8 @@ static pool_t*writeABC(TAG*abctag, void*code, pool_t*pool) abc_file_t*file = (abc_file_t*)code; if(!pool) pool = pool_new(); + if(!file) + file = abc_file_new(); TAG*tmp = swf_InsertTag(0,0); TAG*tag = tmp;