X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fimport.c;h=fb3c7de5b023a7680ea40e29aabacf95a551bf7c;hb=5564aa996b3d6fc258138a7bafc4537431db1c48;hp=0fcba248094ae586b751be0ebda50edc66ee3417;hpb=85df2905e1d050077d079f2f59242aa5e8040eb0;p=swftools.git diff --git a/lib/as3/import.c b/lib/as3/import.c index 0fcba24..fb3c7de 100644 --- a/lib/as3/import.c +++ b/lib/as3/import.c @@ -22,6 +22,8 @@ #include "import.h" #include "abc.h" #include "registry.h" +#include "common.h" +#include "common.h" #include "tokenizer.h" #include "../os.h" @@ -58,6 +60,7 @@ void as3_import_swf(char*filename) tag = tag->next; } + tag = swf->firstTag; /* pass 2 */ while(tag) { if(tag->id == ST_DOABC || tag->id == ST_RAWABC) { @@ -153,7 +156,7 @@ static void import_code(void*_abc, char*filename, int pass) c->flags |= FLAG_DYNAMIC; } return; - } + } for(t=0;tclasses->num;t++) { abc_class_t*cls = array_getvalue(abc->classes, t); @@ -173,6 +176,10 @@ static void import_code(void*_abc, char*filename, int pass) trait_list_t*l=0; char is_static = 0; l = cls->traits; + if(!l) { + l = cls->static_traits; + is_static = 1; + } while(l) { trait_t*trait = l->trait; U8 access = trait->name->ns->access; @@ -242,8 +249,10 @@ static void import_code(void*_abc, char*filename, int pass) m = (memberinfo_t*)methodinfo_register_global(access, package, name); m->return_type = resolve_class(filename, "return type", trait->method->return_type); } else { - m = (memberinfo_t*)varinfo_register_global(access, package, name); - m->type = resolve_class(filename, "type", trait->type_name); + varinfo_t*v = varinfo_register_global(access, package, name); + v->type = resolve_class(filename, "type", trait->type_name); + v->value = constant_clone(trait->value); + m = (memberinfo_t*)v; } m->flags |= FLAG_BUILTIN; m->parent = 0;