From: kramm Date: Fri, 2 Jan 2009 19:46:28 +0000 (+0000) Subject: cutlastpush now handles newobject, newarray, too X-Git-Tag: release-0-9-0~481 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=1325a5112e6a78ab648567fdc0b64ba352b9b8f9;p=swftools.git cutlastpush now handles newobject, newarray, too --- diff --git a/lib/as3/code.c b/lib/as3/code.c index 8a729d4..2374392 100644 --- a/lib/as3/code.c +++ b/lib/as3/code.c @@ -1153,6 +1153,11 @@ code_t* cut_last_push(code_t*c) } else if(c->opcode == OPCODE_CALLSUPER) { c->opcode = OPCODE_CALLSUPERVOID; return c; + } else if(c->opcode == OPCODE_NEWOBJECT || + c->opcode == OPCODE_NEWARRAY) { + // we can discard these if they're not eating up stack parameters + if(!c->data[0]) + return code_cutlast(c); } else break;