aboutsummaryrefslogtreecommitdiff
path: root/graphics/sswf/files/patch-src_libas_compile.c++
blob: 2ff09b15c58408e399f948c623a1c9721c76f432 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- src/libas/compile.c++.orig	2011-06-20 23:06:36.000000000 +0200
+++ src/libas/compile.c++	2011-06-20 23:13:11.000000000 +0200
@@ -706,18 +706,7 @@
 	//	frames and then we search that array with each
 	//	parent of the label
 
-#ifdef _MSVC
-	// alloca() not available with cl
-	class AutoDelete {
-	public: AutoDelete(NodePtr *ptr) { f_ptr = ptr; }
-		~AutoDelete() { delete f_ptr; }
-	private: NodePtr *f_ptr;
-	};
 	NodePtr *parents = new NodePtr[count];
-	AutoDelete ad_parent(parents);
-#else
-	NodePtr parents[count];
-#endif
 	parent = goto_node;
 	for(idx = 0; idx < count; ++idx) {
 		parent = parent.GetParent();
@@ -731,16 +720,19 @@
 		parent = parent.GetParent();
 		if(!parent.HasNode()) {
 			f_error_stream->ErrMsg(AS_ERR_INTERNAL_ERROR, goto_node, "IntCompiler::Goto(): Out of parent before we find the common node?!");
+			delete parents;
 			AS_ASSERT(0);
 			return;
 		}
 		for(idx = 0; idx < count; ++idx) {
 			if(parents[idx].SameAs(parent)) {
 				goto_node.SetLink(NodePtr::LINK_GOTO_EXIT, parent);
+				delete parents;
 				return;
 			}
 		}
 	}
+	delete parents;
 }