# HG changeset patch # User Trass3r # Date 1284413258 -7200 # Node ID 9d194c848e3a31d49f0689b1286a69d32baf8281 # Parent c494af1dba803e6415d4095a086526b9fcf6fbdf fixed a few null reference bugs, thx sagitario diff -r c494af1dba80 -r 9d194c848e3a dmd/DotIdExp.d --- a/dmd/DotIdExp.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/DotIdExp.d Mon Sep 13 23:27:38 2010 +0200 @@ -155,7 +155,7 @@ { auto ee = te.exps[i]; ee = ee.semantic(sc); - ee = new DotIdExp(e.loc, ee, Id.offsetof); + ee = new DotIdExp(ee.loc, ee, Id.offsetof); exps[i] = ee; } e = new TupleExp(loc, exps); diff -r c494af1dba80 -r 9d194c848e3a dmd/FileName.d --- a/dmd/FileName.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/FileName.d Mon Sep 13 23:27:38 2010 +0200 @@ -586,6 +586,8 @@ static void ensurePathExists(string path) { + if (path.length == 0) + return; try { mkdirRecurse(path); } catch { diff -r c494af1dba80 -r 9d194c848e3a dmd/Json.d --- a/dmd/Json.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/Json.d Mon Sep 13 23:27:38 2010 +0200 @@ -24,7 +24,7 @@ void json_generate(Array modules) { - OutBuffer buf; + OutBuffer buf = new OutBuffer(); buf.writestring("[\n"); for (int i = 0; i < modules.dim; i++) diff -r c494af1dba80 -r 9d194c848e3a dmd/Optimize.d --- a/dmd/Optimize.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/Optimize.d Mon Sep 13 23:27:38 2010 +0200 @@ -22,7 +22,7 @@ Expression e = null; if (!v) - return e; + return e; if (v.isConst() || v.isInvariant() || v.storage_class & STC.STCmanifest) { diff -r c494af1dba80 -r 9d194c848e3a dmd/PragmaDeclaration.d --- a/dmd/PragmaDeclaration.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/PragmaDeclaration.d Mon Sep 13 23:27:38 2010 +0200 @@ -61,7 +61,7 @@ if (e.op == TOKstring) { auto se = cast(StringExp)e; - writef("%s", se.toChars()[1..$-2] /*se.len, cast(char*)se.string_*/); + writef("%s", se.toChars()[1..$-2]); // strip the '"'s, TODO: change to original?: /*se.len, cast(char*)se.string_*/ } else writef(e.toChars()); diff -r c494af1dba80 -r 9d194c848e3a dmd/Util.d --- a/dmd/Util.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/Util.d Mon Sep 13 23:27:38 2010 +0200 @@ -386,7 +386,7 @@ for ( ; *p2; p2++) { if (islower(*p2)) *p2 &= ~0x20; - else if (isspace(*p)) + else if (isspace(*p2)) memmove(p2, p2 + 1, strlen(p2)); else if (*p2 == '=') { diff -r c494af1dba80 -r 9d194c848e3a dmd/backend/elem.d --- a/dmd/backend/elem.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/backend/elem.d Mon Sep 13 23:27:38 2010 +0200 @@ -12,6 +12,7 @@ import dmd.backend.TYPE; import dmd.backend.Util; import dmd.backend.Srcpos; +import dmd.backend.OPER; /********************************* * Union of all data types. Storage allocated must be the right @@ -92,8 +93,8 @@ ushort id; } - ubyte Eoper; // operator (OPxxxx) - ubyte Ecount; // # of parents of this elem - 1, + OPER Eoper; // operator (OPxxxx) + ubyte Ecount; // # of parents of this elem - 1, // always 0 until CSE elimination is done eve EV; // variants for each type of elem diff -r c494af1dba80 -r 9d194c848e3a dmd/common.d --- a/dmd/common.d Fri Sep 10 19:14:09 2010 +0100 +++ b/dmd/common.d Mon Sep 13 23:27:38 2010 +0200 @@ -60,6 +60,12 @@ version(MACHOBJ) {} else static assert(false, "TARGET_OSX requires MACHOBJ"); +version(CCASTSYNTAX) {} else + static assert(false, `CCASTSYNTAX is needed for code like "(void*).sizeof"`); + +version(CARRAYDECL) {} else + static assert(false, "C array declarations are used in phobos so we still need CARRAYDECL"); + version(IN_GCC) // Changes for the GDC compiler by David Friedman {