From 1325a5112e6a78ab648567fdc0b64ba352b9b8f9 Mon Sep 17 00:00:00 2001
From: kramm <kramm>
Date: Fri, 2 Jan 2009 19:46:28 +0000
Subject: [PATCH] cutlastpush now handles newobject, newarray, too

---
 lib/as3/code.c |    5 +++++
 1 file changed, 5 insertions(+)

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;
-- 
1.7.10.4