X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fcode.c;h=d5c3acf698a1227b89fc12d3db41f170f2fb51d9;hb=e531f5204757feafa7e09630e4c6b66dd6be6147;hp=67c0d4eea66b4da13827037d23c161432c08fbab;hpb=27378541c501be2529a0af42ad25cba39ae9d083;p=swftools.git diff --git a/lib/as3/code.c b/lib/as3/code.c index 67c0d4e..d5c3acf 100644 --- a/lib/as3/code.c +++ b/lib/as3/code.c @@ -201,7 +201,6 @@ opcode_t opcodes[]={ {0x53, "applytype", "n", -1, 1, 0, OP_STACK_ARGS}, /* dummy instructions. Warning: these are not actually supported by flash */ -{0xfc, "__rethrow__", "", 0, 0, 0, OP_THROW|OP_INTERNAL}, {0xfd, "__fallthrough__", "s", 0, 0, 0, OP_INTERNAL}, {0xfe, "__continue__", "s", 0, 0, 0, OP_RETURN|OP_INTERNAL}, {0xff, "__break__", "s", 0, 0, 0, OP_RETURN|OP_INTERNAL}, @@ -846,11 +845,7 @@ void stats_free(currentstats_t*stats) } } -int code_dump(code_t*c) -{ - return code_dump2(c, 0, 0, "", stdout); -} -int code_dump2(code_t*c, abc_exception_list_t*exceptions, abc_file_t*file, char*prefix, FILE*fo) +int code_dump(code_t*c, abc_exception_list_t*exceptions, abc_file_t*file, char*prefix, FILE*fo) { abc_exception_list_t*e = exceptions; c = code_start(c); @@ -929,8 +924,8 @@ int code_dump2(code_t*c, abc_exception_list_t*exceptions, abc_file_t*file, char* int n = (ptroff_t)data; fprintf(fo, "r%d", n); } else if(*p == 'b') { - int b = (signed char)(ptroff_t)data; - fprintf(fo, "%d", b); + int b = (ptroff_t)data; + fprintf(fo, "%02x", b); } else if(*p == 'j') { if(c->branch) fprintf(fo, "->%d", c->branch->pos); @@ -948,7 +943,7 @@ int code_dump2(code_t*c, abc_exception_list_t*exceptions, abc_file_t*file, char* if(l->def) fprintf(fo, "default->%d", l->def->pos); else - fprintf(fo, "default->00000000"); + fprintf(fo, "default->00000000", l->def->pos); code_list_t*t = l->targets; while(t) { if(t->code) @@ -1011,15 +1006,13 @@ code_t* add_opcode(code_t*atag, U8 op) { code_t*tmp = (code_t*)rfx_calloc(sizeof(code_t)); tmp->opcode = op; + tmp->next = 0; if(atag) { tmp->prev = atag; tmp->next = atag->next; - if(tmp->next) - tmp->next->prev = tmp; atag->next = tmp; } else { tmp->prev = 0; - tmp->next = 0; } return tmp; }