diff dmd/SwitchStatement.d @ 5:63623152e82a

Fixed memory corruption bug which was introduced when attempting to restore GC functionality
author dkoroskin <>
date Tue, 08 Dec 2009 21:39:17 +0300
parents d706d958e4e8
children a8b50ff7f201
line wrap: on
line diff
--- a/dmd/SwitchStatement.d	Mon Oct 26 16:28:19 2009 +0300
+++ b/dmd/SwitchStatement.d	Tue Dec 08 21:39:17 2009 +0300
@@ -49,6 +49,8 @@
 
 import core.memory;
 
+import core.stdc.stdlib;
+
 class SwitchStatement : Statement
 {
     Expression condition;
@@ -408,7 +410,8 @@
 		block_appendexp(mystate.switchBlock, econd);
 		block_next(blx,BCswitch,null);
 
-		targ_llong* pu = cast(targ_llong*) GC.malloc(targ_llong.sizeof * (numcases + 1));
+		/// 
+		targ_llong* pu = cast(targ_llong*) malloc(targ_llong.sizeof * (numcases + 1));
 		mystate.switchBlock.Bswitch = pu;
 		/* First pair is the number of cases, and the default block
 		 */