fixed code_cutlast if there's only one opcode
authorkramm <kramm>
Tue, 30 Dec 2008 22:55:30 +0000 (22:55 +0000)
committerkramm <kramm>
Tue, 30 Dec 2008 22:55:30 +0000 (22:55 +0000)
lib/as3/code.c

index 37339e5..628f4d8 100644 (file)
@@ -1103,10 +1103,12 @@ code_t*code_dup(code_t*c)
 
 code_t*code_cutlast(code_t*c)
 {
+    if(!c) return c;
     assert(!c->next);
     code_t*prev = c->prev;
     c->prev = 0;
-    prev->next=0;
+    if(prev)
+        prev->next=0;
     code_free(c);
     return prev;
 }