Fix null pointer crash

This commit is contained in:
Hackerpilot 2015-09-18 03:58:37 -07:00
parent 380064de6a
commit 4e1cdf23be
4 changed files with 4 additions and 4 deletions

@ -1 +1 @@
Subproject commit 1c5579db6c1d88a097d46f5bee5ae1e2cf8fff02 Subproject commit e83afca7cf2cac48084ba294926d4dd24945dc1a

View File

@ -30,7 +30,7 @@ githash:
git log -1 --format="%H" > githash.txt git log -1 --format="%H" > githash.txt
debug: debug:
${DC} -w -g -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC} ${DC} -w -g -J. -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC}
dmdbuild: githash $(SRC) dmdbuild: githash $(SRC)
mkdir -p bin mkdir -p bin

View File

@ -59,7 +59,7 @@ void assertAnalyzerWarnings(string code, const StaticAnalysisConfig config, stri
ParseAllocator p = new ParseAllocator; ParseAllocator p = new ParseAllocator;
const(Module) m = parseModule(file, cast(ubyte[]) code, p, cache, false); const(Module) m = parseModule(file, cast(ubyte[]) code, p, cache, false);
ModuleCache moduleCache; auto moduleCache = ModuleCache(p);
// Run the code and get any warnings // Run the code and get any warnings
MessageSet rawWarnings = analyze("test", m, config, moduleCache); MessageSet rawWarnings = analyze("test", m, config, moduleCache);

View File

@ -118,7 +118,7 @@ int main(string[] args)
const(string[]) absImportPaths = importPaths.map!( const(string[]) absImportPaths = importPaths.map!(
a => a.absolutePath().buildNormalizedPath()).array(); a => a.absolutePath().buildNormalizedPath()).array();
ModuleCache moduleCache; auto moduleCache = ModuleCache(new dsymbol.modulecache.ASTAllocator);
if (absImportPaths.length) if (absImportPaths.length)
moduleCache.addImportPaths(absImportPaths); moduleCache.addImportPaths(absImportPaths);