X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fcode.c;h=233b996ea8286df5b97c2b21e6c1a469dc38a221;hb=804043c4154176a5158403b9437bf3c17996054e;hp=67c0d4eea66b4da13827037d23c161432c08fbab;hpb=27378541c501be2529a0af42ad25cba39ae9d083;p=swftools.git diff --git a/lib/as3/code.c b/lib/as3/code.c index 67c0d4e..233b996 100644 --- a/lib/as3/code.c +++ b/lib/as3/code.c @@ -207,20 +207,18 @@ opcode_t opcodes[]={ {0xff, "__break__", "s", 0, 0, 0, OP_RETURN|OP_INTERNAL}, }; -static U8 op2index[256] = {254}; +static opcode_t* op2op[256] = {0,0,0}; -opcode_t* opcode_get(U8 op) +static inline opcode_t* opcode_get(U8 op) { int t; - if(op2index[0]==254) { - memset(op2index, 255, sizeof(op2index)); + if(!op2op[0x02]) { + memset(op2op, 0, sizeof(op2op)); for(t=0;tnext = c; + c->prev = code; code = c; } @@ -910,11 +909,11 @@ int code_dump2(code_t*c, abc_exception_list_t*exceptions, abc_file_t*file, char* free(m); } else if(*p == 'm') { abc_method_t*m = (abc_method_t*)data; - fprintf(fo, "[method %08x %s]", m, m->name); + fprintf(fo, "[method %08x %s]", m->index, m->name); } else if(*p == 'c') { abc_class_t*cls = (abc_class_t*)data; char*classname = multiname_tostring(cls->classname); - fprintf(fo, "[classinfo %s]", classname); + fprintf(fo, "[classinfo %08x %s]", cls->index, classname); free(classname); } else if(*p == 'i') { abc_method_body_t*b = (abc_method_body_t*)data;