changeset 177:1475fd394c9e

bug fixes
author korDen
date Sun, 10 Oct 2010 10:38:55 +0400
parents fa9a71a9f5a8
children e3afd1303184
files dmd/CompoundStatement.d dmd/DsymbolTable.d dmd/FuncDeclaration.d dmd/Global.d dmd/StringExp.d dmd/Type.d dmd/Util.d dmd/backend/glue.d dmd/backend/iasm.d dmd/codegen/Util.d
diffstat 10 files changed, 18 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/CompoundStatement.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/CompoundStatement.d	Sun Oct 10 10:38:55 2010 +0400
@@ -66,10 +66,8 @@
 	{
 		foreach (s; statements)
 		{
-			if (s) {
-				s.toChars();
+			if (s)
 				s.toCBuffer(buf, hgs);
-			}
 		}
 	}
 	
--- a/dmd/DsymbolTable.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/DsymbolTable.d	Sun Oct 10 10:38:55 2010 +0400
@@ -19,7 +19,6 @@
 	
     ~this()
 	{
-		delete tab;
 	}
 
     // Look up Identifier. Return Dsymbol if found, NULL if not.
--- a/dmd/FuncDeclaration.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/FuncDeclaration.d	Sun Oct 10 10:38:55 2010 +0400
@@ -3293,6 +3293,8 @@
 
 		if (semanticRun >= 5)	// if toObjFile() already run
 			return;
+			
+		semanticRun = 5;
 
 		if (!func.fbody)
 		{
--- a/dmd/Global.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/Global.d	Sun Oct 10 10:38:55 2010 +0400
@@ -201,15 +201,6 @@
 
 		sarray = new Array();
 		
-		scope Scope sc = new Scope();
-
-		tftohash = new TypeFunction(null, Type.thash_t, 0, LINK.LINKd);
-		tftohash.mod = MOD.MODconst;
-		tftohash = cast(TypeFunction)tftohash.semantic(Loc(0), sc);
-
-		tftostring = new TypeFunction(null, Type.tchar.invariantOf().arrayOf(), 0, LINK.LINKd);
-		tftostring = cast(TypeFunction)tftostring.semantic(Loc(0), sc);
-		
 		obj_symbols_towrite = new Array();
 		
 		ectorgates = new Array();
@@ -220,6 +211,15 @@
 	void initClasssym()
 	{
 		scc = fake_classsym(Id.ClassInfo);
+		
+		scope Scope sc = new Scope();
+
+		tftohash = new TypeFunction(null, Type.thash_t, 0, LINK.LINKd);
+		tftohash.mod = MOD.MODconst;
+		tftohash = cast(TypeFunction)tftohash.semantic(Loc(0), sc);
+
+		tftostring = new TypeFunction(null, Type.tchar.invariantOf().arrayOf(), 0, LINK.LINKd);
+		tftostring = cast(TypeFunction)tftostring.semantic(Loc(0), sc);
 	}
 
 	void init_time()
--- a/dmd/StringExp.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/StringExp.d	Sun Oct 10 10:38:55 2010 +0400
@@ -856,7 +856,7 @@
 			e.Eoper = OPER.OPstring;
 static if (true) {
 			// Match MEM_PH_FREE for OPstring in ztc\el.c
-			e.EV.ss.Vstring = cast(char*)GC.malloc((len + 1) * sz); /// !
+			e.EV.ss.Vstring = cast(char*)malloc((len + 1) * sz); /// !
 			memcpy(e.EV.ss.Vstring, string_, (len + 1) * sz);
 } else {
 			e.EV.ss.Vstring = cast(char*)string_;
--- a/dmd/Type.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/Type.d	Sun Oct 10 10:38:55 2010 +0400
@@ -2851,7 +2851,7 @@
 	@property
 	static ref Type[TY.TMAX] basic()
 	{
-		return basic;
+		return global.basic;
 	}
 
 	static Type tvoid()
--- a/dmd/Util.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/Util.d	Sun Oct 10 10:38:55 2010 +0400
@@ -1139,7 +1139,7 @@
 }
 }
 }
-
+/*
 extern(C++) void util_assert(char* file,int line)
 {
     fflush(stdout);
@@ -1177,4 +1177,4 @@
 	{
 		return mem_calloc(size);
 	}
-}
\ No newline at end of file
+}*/
\ No newline at end of file
--- a/dmd/backend/glue.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/backend/glue.d	Sun Oct 10 10:38:55 2010 +0400
@@ -60,7 +60,6 @@
 	
     ~this()
 	{
-		assert(false);
 	}
 	
     void reset()
--- a/dmd/backend/iasm.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/backend/iasm.d	Sun Oct 10 10:38:55 2010 +0400
@@ -4396,7 +4396,7 @@
 		o1.ptype = d.type.toBasetype();
 }
 
-enum REG[63] regtab = 
+__gshared REG[63] regtab = 
 [
 	{"AL",	_AL,	_r8 | _al,},
 	{"AH",	_AH,	_r8,},
--- a/dmd/codegen/Util.d	Sun Oct 10 05:22:45 2010 +0400
+++ b/dmd/codegen/Util.d	Sun Oct 10 10:38:55 2010 +0400
@@ -1132,7 +1132,7 @@
 					es.Eoper = OPER.OPstring;
 
 					// Match MEM_PH_FREE for OPstring in ztc\el.c
-					es.EV.ss.Vstring = cast(char*)GC.malloc(len);	/// !
+					es.EV.ss.Vstring = cast(char*)malloc(len);	/// !
 					memcpy(es.EV.ss.Vstring, &e.EV, len);
 
 					es.EV.ss.Vstrlen = len;