X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fcode.c;h=541ebf55ba714d532b7a0697a0efe58a0016549a;hb=c63b2bf21dc1df9a736f0b4c08f6cba828cdab92;hp=31c986f2fdaa66109f8536973c5581dc9a4e35be;hpb=b8aa0577aae67db4da5221459102202febc5c103;p=swftools.git diff --git a/lib/as3/code.c b/lib/as3/code.c index 31c986f..541ebf5 100644 --- a/lib/as3/code.c +++ b/lib/as3/code.c @@ -255,10 +255,10 @@ code_t* code_atposition(codelookup_t*l, int pos) void lookupswitch_print(lookupswitch_t*l) { - printf("default: %08x\n", l->def); + printf("default: %08x\n", (int)l->def); code_list_t*t = l->targets; while(t) { - printf("target: %08x\n", t->code); + printf("target: %08x\n", (int)t->code); t = t->next; } } @@ -990,7 +990,7 @@ int code_dump2(code_t*c, abc_exception_list_t*exceptions, abc_file_t*file, char* if(c->branch) fprintf(fo, "->%d", c->branch->pos); else - fprintf(fo, "%08x", c->branch); + fprintf(fo, "%08x", (unsigned int)c->branch); } else if(*p == 's') { char*s = string_escape((string_t*)data); fprintf(fo, "\"%s\"", s); @@ -1225,6 +1225,19 @@ code_t*code_cutlast(code_t*c) return code_cut(c); } +char is_getlocal(code_t*c) +{ + if(!c) return 0; + if(c->opcode == OPCODE_GETLOCAL || + c->opcode == OPCODE_GETLOCAL_0 || + c->opcode == OPCODE_GETLOCAL_1 || + c->opcode == OPCODE_GETLOCAL_2 || + c->opcode == OPCODE_GETLOCAL_3) { + return 1; + } + return 0; +} + code_t* cut_last_push(code_t*c) { assert(!c->next);